Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

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: (7)
As of 2016-02-09 08:58 GMT
Find Nodes?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?

    Results (309 votes), past polls