Pathologically Eclectic Rubbish Lister | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I certainly can't answer for all OSes, nor even all Unix-like OSes, but on Linux, SIGKILL (signal 9) cannot be trapped. SIGKILL is essentially the untrappable version of SIGINT (which is what Ctrl+C tends to send in the terminal). Also, SIGSTOP cannot be caught, but SIGSTOP doesn't kill a process, it pauses it. SIGSTOP is the untrappable version of SIGTSTP (which is what Ctrl+Z tends to send in the terminal). Of course, just because a process cannot trap and handle the signal, doesn't mean that the signal is 100% instant and reliable. Signals can fail to work, or take some time to work for other reasons (e.g. bugs, busy CPU, etc). Aside: If a process is chewing up your CPU and you need to stop it for a while, kill -s STOP <process_number> is a pretty handy facility. When you're happy for it to start chewing again kill -s CONT <process_number> will restart it. The process is unlikely to even notice you paused it.
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
In reply to Re^3: ***Warning! The above post is wrong in almost every possible way***
by tobyink
|
|