Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 Jan 5 '13 at 14:00

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

See What are “session leaders” in ps? at Unix&Linux SE. – Piotr Dobrogost Feb 3 '15 at 11:11
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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .