Process Hierarchy
-
Init Process
- Kernel starts
initafter boot, always assigned PID 1. - System V:
/sbin/init - systemd:
/bin/systemd→ usually links to/lib/system/systemd.
- Kernel starts
-
Parent and Child Processes
- Process starting another → Parent Process
- Process started → Child Process
- Parent PID is labeled PPID.
-
PID Limits
- Maximum PID value can be viewed/changed:
/proc/sys/kernel/pid_max - After reaching maximum, PID rolls over to available values.
- Maximum PID value can be viewed/changed:
-
Process Tree
- Processes can be visualized as a family tree.
- Command:
pstreeExample:
* Relationships from example:sysadmin@localhost:~$ pstree init-+-cron |-login---bash---pstree |-named---18*[{named}] |-rsyslogd---2*[{rsyslogd}] `-sshdinit→ parent ofloginlogin→ child ofinit, parent ofbashbash→ child oflogin, parent ofpstreepstree→ child ofbash