LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-10-2008, 09:43 AM   #1
Curtor
Member
 
Registered: Feb 2008
Posts: 65

Rep: Reputation: 16
Detailed information on PID and SID


I've searched around a bit, and have bee unable to find this information.

If someone has a link to a useful document or forum, it would be much appreciated.

In short, I would like to know, in detail, what exactly process and session identifiers are and how they work.

How are they assigned? What does it mean to create a new session? When are new sessions created, and what happens when a process forks. What is and is not inherited by the child? Can you kill a session? If so, what happens when you do? etc. etc.
 
Old 12-10-2008, 02:50 PM   #2
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
The PID is as you said a Process ID. It is a way to manager what ever process is attached to that ID. That is due to how processors and the kernel looks at things. IE DHCPD is the human name we use but once the daemon is spawned it will hook on to the system and be given an ID to be managed. Of course this is just a very high level look. this may help you
http://linux.die.net/man/7/credentials
 
Old 12-11-2008, 09:11 AM   #3
Curtor
Member
 
Registered: Feb 2008
Posts: 65

Original Poster
Rep: Reputation: 16
Thank you, this page does answer some of my questions.

Although I am still uncertain about a few things, like what occurs when a process creates a new process group (so it is the process group leader), forks additional children, and then exits.

If a process group exists with multiple processes, and the process group leader exits, who becomes the new process group leader? Or is it now a process group with no leader? Do sessions and and groups work the same only on two different tiers?
 
Old 12-11-2008, 09:32 AM   #4
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
Try here this will cover the rest. http://linuxgazette.net/133/saha.html
Let me if this doesn't cover the rest. I will try my best to answer any other questions.
 
Old 12-11-2008, 10:05 AM   #5
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by Curtor View Post
Thank you, this page does answer some of my questions.

Although I am still uncertain about a few things, like what occurs when a process creates a new process group (so it is the process group leader), forks additional children, and then exits.

If a process group exists with multiple processes, and the process group leader exits, who becomes the new process group leader? Or is it now a process group with no leader? Do sessions and and groups work the same only on two different tiers?

The correct term is Parent Process. So yes you could say that then Parent Process will be linked to all child processes. if the Parent process is killed then all children processes will be killed. Sounds gory huh with all this killing and what not. Ok bad joke. Better not quite my daytime job to become a comedian.
 
Old 12-11-2008, 10:20 AM   #6
Curtor
Member
 
Registered: Feb 2008
Posts: 65

Original Poster
Rep: Reputation: 16
It's not the killing that's so bad, but the fact that they are just children!
Anyway.

So, parent process dies, so does all the children. Seems to make sense, based on what I read here: http://linux.die.net/man/1/kill.

What if the children are set up to catch and ignore any signal that they can? Kill just sends a signal, which the parent could exit on and the children could ignore.
 
Old 12-11-2008, 10:31 AM   #7
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by Curtor View Post
It's not the killing that's so bad, but the fact that they are just children!
Anyway.

So, parent process dies, so does all the children. Seems to make sense, based on what I read here: http://linux.die.net/man/1/kill.

What if the children are set up to catch and ignore any signal that they can? Kill just sends a signal, which the parent could exit on and the children could ignore.
Never heard or seen that happen but I am sure that could be coded. But I view it like a tree with the brances being the child. If you cut a limb off the tree is still there. but you cut the trunk off the whole tree goes.
 
  


Reply



Posting 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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
can't read sid for pid 30771: what does it mean? arm74 Linux - General 1 02-02-2007 09:42 AM
Detailed information on Fedora services mrkawphy Linux - Newbie 1 08-22-2006 12:45 PM
What is script PID information? Stepaj47 Linux - Newbie 7 11-15-2005 02:50 PM
/var/run/[XXX].pid - Tcl pid code liguorir Linux - Software 1 05-20-2004 10:32 PM
ERROR: Couldn't write pid to pid file lawrencegoodman Linux - Newbie 2 02-13-2004 08:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration