Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: kill command in perl?

by hbo (Monk)
on Jul 30, 2004 at 07:20 UTC ( #378612=note: print w/ replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://378612]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2016-06-25 00:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (322 votes). Check out past polls.