|
|
Possible to assign a PID?
|
|
|
|
Senior User
Join Date: Jan 2002
Location: City of Beck's beer
Status:
Offline
|
|
Hi!
When I start 'top' within the terminal I can see PID allocated to every application running. The problem is that these PIDs change everytime I restart an application. Is there a possibility to assign a specific PID to an app when it launches? Is there a 3rd party app or similar?
Cheers, Thilo
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: May 1999
Location: San Jose, CA
Status:
Offline
|
|
No. PIDs are assigned automatically by the OS as applications are launched, and are not user controlled. That way the system can ensure the PIDs are unique.
Why do you think you need to manually assign a PID? There's plenty of ways of obtaining the PID of a running program so you don't need to know what the PID is in advance.
|
Gods don't kill people - people with Gods kill people.
|
|
|
|
|
|
|
|
Forum Regular
Join Date: Apr 2000
Location: Swampscott, MA
Status:
Offline
|
|
Some apps when restarted keep their pids...
restarting named with kill -HUP `cat /var/named.pid` (or whatevers) keeps the pid the same.
|
|
|
|
|
|
|
|
|
Senior User
Join Date: Sep 2000
Location: Boston, MA
Status:
Offline
|
|
well, thats not technically restarting it.
You're sending a specific signal to the
software (HUP or -1) and the software has
been written to intercept it and perform
a specific task such as forcing a
re-read of the configuration files w/o
stopping and restarting the software.
You cannot (in any implementation I've
seen), pre-assign a PID. It's up to
the kernel to make that assignment.
That is why you often see complex
schemes like writing the xxx.pid file
to /var/run or something and then
forcing a read from that.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|