dynamic pid?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers dynamic pid?
# 1  
Old 12-17-2002
dynamic pid?

hi, i noticed that the pid of a process can change.. is that true?

like now i do a ps on my terminal.. and there is a list of process with their pids.. and later with the same process, (without qutting and runnign the same process) this time round, their pid are different?

is it true?
yls177
# 2  
Old 12-17-2002
You have a parent process that each time you do a ps -ef and grep for your userid, you will see the same parent, but different children processes.

$ ps -ef|grep unixops
unixops 8075 8070 0 13:53:20 pts/11 0:00 grep unixops
unixops 8070 595 1 13:53:13 pts/11 0:00 -ksh
$ ps -ef|grep unixops
unixops 8077 8070 0 13:53:27 pts/11 0:00 grep unixops
unixops 8070 595 1 13:53:13 pts/11 0:00 -ksh

Note that each show pid 8070 (-ksh) but the "grep unixops" has different pids. After completing the requested work (searching for unixops), the child process died. This is normal.
# 3  
Old 12-17-2002
Processes don't change process IDs. However, processes can spawn other processes and each of those will have a different process id.... in turn, those process ids do not change, they are born and they die.

Parent processes spawn child processes and children can also become parents, etc. (like RTM was explaining)

Because we call them parent and child processes and because processes die (and are killed), parent and child processes are the subject of many jokes about "forking children" "killing children" ... "parents killing their children" etc.

... these jokes are normally made by UNIX novices who have just discovered parent/child process relationships.... then after a short time, the vocabulary become natural and the jokes are not (generally) used by 'UNIX adults'...... (mature UNIX users)... we just do the work... so to speak.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Pid=$!

Hello, I would like to know what this command means? PID=$! what does "!" stand for? (5 Replies)
Discussion started by: googlietdr
5 Replies

2. Shell Programming and Scripting

How to Kill process with dynamic PID?

Hello, I have problem with killing red5 process running on linux server. As this process is continuously changing its PID so it can't be killed with "kill -9 PID" command. First I used following command to list RED5 process ps aux | grep red5 which showed me root 5832 0.0 0.0 4820 756pts/0... (4 Replies)
Discussion started by: ninadgac
4 Replies

3. UNIX for Dummies Questions & Answers

How to Kill process with dynamic PID?

Hello, I have problem with killing red5 process running on linux server. As this process is continuously changing its PID so it can't be killed with "kill -9 PID" command. First I used following command to list RED5 process ps aux | grep red5 which showed me root 5832 0.0 0.0 4820 756pts/0... (1 Reply)
Discussion started by: ninadgac
1 Replies

4. UNIX for Advanced & Expert Users

Sql dynamic table / dynamic inserts

I have a file that reads File (X.txt) Contents of record 1: rdrDESTINATION_ADDRESS (String) "91 971502573813" rdrDESTINATION_IMSI (String) "000000000000000" rdrORIGINATING_ADDRESS (String) "d0 movies" rdrORIGINATING_IMSI (String) "000000000000000" rdrTRAFFIC_EVENT_TIME... (0 Replies)
Discussion started by: magedfawzy
0 Replies

5. UNIX for Dummies Questions & Answers

Need to get pid of a process and have to store the pid in a variable

Hi, I need to get the pid of a process and have to store the pid in a variable and i want to use this value(pid) of the variable for some process. Please can anyone tell me how to get the pid of a process and store it in a variable. please help me on this. Thanks in advance, Amudha (7 Replies)
Discussion started by: samudha
7 Replies

6. Shell Programming and Scripting

Pid

How can I put the process id of ,for example, the following script to the pid file? Maybe $$ must be defined in some place? daemon(){ while true; do if then echo "`date +"%H:%M:%S"`" >> $FILE ... (4 Replies)
Discussion started by: mirusnet
4 Replies

7. Shell Programming and Scripting

KILL PID, intern should kill another PID.

Hi All, In my project i have two process runs in the back end. Once i start my project, and execute the command ps, i get below output: PID TTY TIME CMD 9086 pts/1 0:00 ksh 9241 pts/1 0:02 java 9240 pts/1 0:00 shell_script_bg java with 9241 PID is the main... (4 Replies)
Discussion started by: rkrgarlapati
4 Replies

8. UNIX for Dummies Questions & Answers

Session PID & socket connection pid

1. If I use an software application(which connects to the database in the server) in my local pc, how many PID should be registered? Would there be PID for the session and another PID for socket connection? 2. I noticed (through netstat) that when I logged in using the my software application,... (1 Reply)
Discussion started by: pcx26
1 Replies

9. UNIX for Dummies Questions & Answers

getting PID

Hi , I am trying to get the PID using the following command: $ /usr/ucb/ps -auwwwwx | grep java | grep Proceess | ptree PID or $ /usr/ucb/ps -auwwwwx | grep java | grep Proceess;ptree PID it is possible to get PID, such that I check whether any orphan process is running. solution... (0 Replies)
Discussion started by: Rakesh Bhat
0 Replies

10. Programming

printing ppid,child pid,pid

question: for the below program i just printed the value for pid, child pid and parent pid why does it give me 6 values? i assume ppid is 28086 but can't figure out why there are 5 values printed instead of just two! can someone comment on that! #include<stdio.h> #define DIM 8 int... (3 Replies)
Discussion started by: a25khan
3 Replies
Login or Register to Ask a Question