[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [K12OSN] Stubborn users that refuse to die!

David Trask wrote:
> Just curious....would it be a bad thing to integrate the "kill -9" command
> into TeacherTool instead of just plain "kill"?  That way it would always
> work.??????  Or would that be bad?

kill sends an interrupt to a process.  You can control which interruptit
sends  by specifying it on the command line.  If you don't specify one,
it'll send a SIGTERM, which is equivalent to a ctrl-C.  When a process
receives a SIGTERM, it has an opportunity to clean up after itself
before going away (that is, it can delete any lock files it may have
created, close any network connections between it and a client or
server, etc).  

The downside of SIGTERM, and the reason it doesn't always work, is that
a process can choose to ignore it or mask it out.  It does not have that
option with a SIGKILL which I belive is non-maskable.  Iwould guess that
SIGKILL is handled by the OS - the process doesn't actually do anything
- the scheduler just decides to shut it down.  The process therefore has
no opportunity to clean up after itself - it dies intestate.

SIGTERM doesn't always work either though, but this only happens if the
process is stuck in the kernel somewhere (I guess).

My advice would be to try using a SIGTERM, and if that didn't work,
"kill it dead" using SIGKILL.

Jim Thomas            Principal Applications Engineer  Bittware, Inc
jthomas bittware com  http://www.bittware.com          (703) 779-7770
The sooner you get behind, the more time you'll have to catch up

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]