Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

See the command bellow

# ps ax | grep bitlbee
 2271 ?        Ss     0:00 /usr/bin/bitlbee -s mysql -c /root/config.conf
 3930 ?        S      0:00 /usr/bin/bitlbee -s mysql -c /root/config.conf

See the STAT column. Here is the explanation

S    Interruptible sleep (waiting for an event to complete)
s    is a session leader

What is session leader here? Also what is session here? How do I know which of these 2 process is active?

share|improve this question

migrated from stackoverflow.com Jan 5 '13 at 14:00

This question came from our site for professional and enthusiast programmers.

add comment

1 Answer

up vote 4 down vote accepted

From The Linux Kernel: Processes:

10.3 Sessions

Every process group is in a unique session. (When the process is created, it becomes a member of the session of its parent.) By convention, the session ID of a session equals the process ID of the first member of the session, called the session leader. A process finds the ID of its session using the system call getsid().

Every session may have a controlling tty, that then also is called the controlling tty of each of its member processes. A file descriptor for the controlling tty is obtained by opening /dev/tty. (And when that fails, there was no controlling tty.) Given a file descriptor for the controlling tty, one may obtain the SID using tcgetsid(fd).

As to your last question

How do I know which of these 2 process is active?

Given that both processes are sleeping, the answer is "neither".

share|improve this answer
    
Thanks a lot. The perfect explanation –  Shiplu Jan 5 '13 at 12:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.