Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
Keep It Simple, Stupid
 
PerlMonks  

Re: working with pid's

by Maqs (Deacon)
on Sep 18, 2000 at 17:34 UTC ( #32947=note: print w/ replies, xml ) Need Help??


in reply to working with pid's

you may use rather pidfiles and read them or do ps lookups as shown below
note: this code was not hardly tested:

my %name2pid; @qpids = `ps -aux | grep q3ded`; foreach $qpid (@qpids){ ($pid, $name)=(split /\s/, $qpid)[0,-1] $name=~s/^(.*)\..*/$1/; $name2pid{$name}=$pid;
now %name2pid contains pairs "servername<->pid" and you can manupulate them
i.e. $name2pid{'ctf'} gives you ctf server's pid number.

/Maqs.


Comment on Re: working with pid's
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (12)
As of 2014-04-23 09:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (541 votes), past polls