Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
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 making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2015-07-03 16:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (54 votes), past polls