Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
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


Comment on Re: kill command in perl?
Download Code
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 surveying the Monastery: (3)
As of 2014-08-02 03:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who would be the most fun to work for?















    Results (54 votes), past polls