Saturday, March 9, 2013

Process Group and Session

When a new user logs in, the login process creates a new session containa single process (login shell), which is also the process group leader.  The process leader's PID is used as the process group ID as well as the session ID.

Process group is used to facilitate job control in UNIX.  It simply the task to send singal  to all process in group.  For example, when a user exit a terminal, SIGQUIT is sent to all processes in the foreground group.  SIGHUP is sent when a network disconnect is detected by a terminal.  SIGNIT is sent when a user presses Control-C (interrupt key).

The command "cat file.text | grep error | more" create a process group with 3 processes.

Session arrange a user's activities and associate that user with a controlling terminal which handle the terminal I/O. 

No comments: