Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run a application daemon with SID that I assign?

Status
Not open for further replies.

sillyVM

Technical User
Feb 14, 2007
144
US
Is there a way to run a process with static SID that I can assign? say I want a daemon run as SID#0083, is it possible?
 
I can't delete the post, but I am trying to ask how to run it with a certain PID (process ID) not SID. Sorry for the confusing topic.
 
I don't believe you can force a PID.
You can, however, use the daemon routines in perl, bash, etc. to have the application itself find whether it has a related, open PID before it takes an action like opening another instance of itself. Very common function. Check your scripts in /etc/init.d for bash examples.

What purpose had you intended for a specific PID? Perhaps you could ask THAT question?

D.E.R. Management - IT Project Management Consulting
 
What about the pidfile=$(PIDFILE=/var/run/httpd.pid), Doesn't that specify a PID for the process httpd?

No particular purpose, I guess it will make our application easier to identify. Say we have two daemons both uses JAVA, only distinction is different PID, and we want to kill one but not the other, it will be better if we run it with specific PID.
 
hi sillyVM,

try a "echo $PPID" and then consult the bash manual.
There are shell tricks to create files just like the httpd.pid file.

Good luck,

Ted
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top