in reply to kill command in perl?

But if those processes are running on "other servers," you will have to issue a remote kill, with the shell, in that signal handler:
$SIG{INT} = $SIG{TERM} = sub { `ssh remote_server killall -9 everything`; exit; };
You might want to be more selective than in the example. 8)

"Even if you are on the right track, you'll get run over if you just sit there." - Will Rogers

Replies are listed 'Best First'.
Re^2: kill command in perl?
by Joost (Canon) on Jul 30, 2004 at 08:53 UTC
Re^2: kill command in perl?
by exussum0 (Vicar) on Jul 30, 2004 at 10:39 UTC
    The easiest way to be more selective, is to generate a random number, md5 it and pass it along as a dummy parameter. I've done that by wrapping the target server program in a perl script, and simply ignoring it. When I have to kill the thing off, i check the process list for that random number so that I kill less things off. I also have the perl script on the remote server kill itself off in reasonable time in case someone yanks a net cable.

    Bart: God, Schmod. I want my monkey-man.