Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
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 drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2014-09-20 19:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (160 votes), past polls