Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > Possible to assign a PID?

Possible to assign a PID?
Thread Tools
Thilo Ettelt
Senior User
Join Date: Jan 2002
Location: City of Beck's beer
Status: Offline
Reply With Quote
Nov 25, 2002, 11:14 AM
 
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
     
Camelot
Mac Elite
Join Date: May 1999
Location: San Jose, CA
Status: Offline
Reply With Quote
Nov 25, 2002, 11:47 PM
 
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.
     
mjpaci
Forum Regular
Join Date: Apr 2000
Location: Swampscott, MA
Status: Offline
Reply With Quote
Nov 27, 2002, 01:43 PM
 
Some apps when restarted keep their pids...

restarting named with kill -HUP `cat /var/named.pid` (or whatevers) keeps the pid the same.
     
howardm4
Senior User
Join Date: Sep 2000
Location: Boston, MA
Status: Offline
Reply With Quote
Nov 27, 2002, 03:54 PM
 
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 Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 11:49 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,