Friday, March 9, 2012

Kill


kill 1        ==> The process with pid 1 will be signaled.
kill 0        ==> All processes in the current process group are signaled., except the shell
kill -1       ==> All processes with pid larger than 1 will be signaled.
kill -9       ==> don't allow to save files
kill -15     ==> allows maintainability , like file saving etc,gracefully.
kill -9 $$  ==> kills current shell as $$ has the PID of current shell.
kill $!       ==> Kills the last background job
!! repeats the previous command :)


If you want to terminate a process (eggdrop etc) use kill -15, as this will allow your process to perform any maintenance it needs to do before teminating (i.e. the eggdrop will be able to save its current userfile and settings before closing). Only if the process fails to respond to this use kill -9, as this will send a teminate signal without allowing any maintenance to be done before the process stops.
Kill a process corresponding to a PID number.
kill -15 #PID          (Only use kill -9 #pid if your bot does not respond to a kill -15 #pid signal)
kill -9 #PID
kill -9 32667
Kill / Terminate all running processes in your account.
kill -15 -1
kill -9 -1
The uptime shell command shows the time since the system was last booted, the number of active user processes and a final column showing something called load averages. The 3 Values for load averages are taken from the last 1, 5 and 15 minutes and represent CPU utilisation.

Ideally a load average below 1 is ideal, when you start to commonly see averages above 2 you should consider investing in a new server or upgrades to current hardware. You will notice high load average by poor response times from the machine.

No comments:

Post a Comment