Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^3: custom name to the process

by Eimi Metamorphoumai (Deacon)
on Dec 04, 2007 at 22:15 UTC ( [id://654973]=note: print w/replies, xml ) Need Help??


in reply to Re^2: custom name to the process
in thread custom name to the process

Well, you can check the value of $0 and do different things with it. But probably the best solution is to use different parameters to ps. For instance, ps -fe will give you the parameters passed to each instance, which is probably a pretty good way of distinguishing your processes.

Replies are listed 'Best First'.
Re^4: custom name to the process
by aquarium (Curate) on Dec 04, 2007 at 22:41 UTC
    As has been hinted at, some OSes specifically disable showing of parameters, as showing those can prove to be security hole....e.g. you can see which config files are used by some programs OR even see userid/password passed to a program as parameters.
    symlinks are probably the best bet, as you can't reserve PID, for reasons of OS stability/security. You could easily though print the PID from the program when it starts each time, by printing the $$ variable.
    the hardest line to type correctly is: stty erase ^H

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (6)
As of 2024-04-16 19:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found