Search code examples
linuxunixpidproc

Reserved Process ID


As per my knowledge Process ID 1 is reserved for init.

What does process id 2 indicate? why no softlink to the binary executable for this process ID.

sudo ls -l /proc/1/exe    
lrwxrwxrwx 1 root root 0 Apr 24 14:53 /proc/1/exe --> /sbin/init  

But for /proc/2/exe

ls : cannot read symbolic link /proc/2/exe: No such file or directory
lrwxrwxrwx 1 root root 0 Apr 24 14:53 /proc/2/exe

Im using Ubuntu 12.04.

pls share your knowledge.


Solution

  • because at the moment you are asking there is no process of pid 2. the kernel allocates pids at will.

    Or because pid 2 is for some kernel task; on my machine it is for kthreadd which is some pure kernel process. See this answer.