Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I currently shut Skype down by using ps ax | grep skype and then issuing kill -9 on the PIDs. There are three PIDs to be killed.

What are the adverse consequences for Ubuntu that result from killing Skype this way? I am concerned about resources not being freed or garbage files being left in various places.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

You're right to be concerned.

Unix/Linux programs can register signal handling routines. These are called when they receive signals from the oparating system. You can see a full list of signals using man 7 signal (or online here)

When you call kill, it sends a signal to the process. The default signal is SIGTERM (this is equivalent to kill -15, kill -TERM or simply kill) and the default behavior is for the app to quit. More sophisticated apps, probably including Skype, will set up a signal handling routine to properly close connections and perhaps save some session information.

When you do kill -9 (or its equivalent kill -KILL) you send SIGKILL. As explained in the signal man page, "The signals SIGKILL and SIGSTOP cannot be caught, blocked, or ignored." This means that no signal handling routine will be executed and all the nice stuff that Skype's programmers put in to make their software behave on your system is ignored.

You should always try killing processes without -9 first. If that doesn't work, only then should you try kill -9.

Aside: You may see that some daemons support kill -HUP to reload configuration file. These programs have signal handlers configured to run when they receive SIGHUP. The kill program is named in a way to suggest that it always kills programs, but it's really just a way to send signals.

share|improve this answer

Hard to know unless you got Skype source code, which AFAIK is closed source. Anyway you should try kill -TERM first before attempting a more potentially more damaging kill -KILL. Also I suggest using -KILL instead of -9, it's more readable. You might also want to take a look at killall command.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.