1,140 views

1 Answer

5 votes
5 votes

sh does have a parent process and its parent is whoever has called sh.

arjun@armi:~$ ps -f 3985
UID        PID  PPID  C STIME TTY      STAT   TIME CMD
arjun     3985  3887  0 13:17 pts/13   S+     0:00 sh

login also has parent and its parent is the init process.

arjun@armi:~$ ps -f 498
UID        PID  PPID  C STIME TTY      STAT   TIME CMD
root       498     1  0 13:11 ?        Ss     0:00 /lib/systemd/systemd-logind

same for dev

arjun@armi:~$ ps -f 419
UID        PID  PPID  C STIME TTY      STAT   TIME CMD
root       419     1  0 13:11 ?        Ss     0:00 /lib/systemd/systemd-udevd --daemon

So, the answer is "kernel" which has process id 0 and is the parent of the "init" process. 

http://unix.stackexchange.com/questions/83322/which-process-has-pid-0

Related questions

1 votes
1 votes
1 answer
3
Umang Raman asked Oct 15, 2015
1,674 views
Which one of the following is allowed only in kernel mode?A) Read the time of day clockB) Save the status of processC) change the PC content.D) non of these