Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

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.


Comment on Re: working with pid's
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2015-11-25 09:53 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (672 votes), past polls