首先,这是我的系统环境:
# cat /proc/version
Linux version 4.15.0-52-generic (buildd@lgw01-amd64-051) (gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)) #56-Ubuntu SMP Tue Jun 4 22:49:08 UTC 2019
# cat /etc/issue
Ubuntu 18.04.2 LTS \n \l
Run Code Online (Sandbox Code Playgroud)
参考这个Ubuntu Wiki,ubuntu从15.04开始默认使用Systemd,Systemd以PID 1作为运行/sbin/init。但是,我在 ubuntu 18.04 上发现了不同的结果:
# ps aux | awk '$2==1{print $0}'
root 1 0.0 0.8 159692 8784 ? Ss Oct24 0:21 /sbin/init noibrs splash
# lsof -p 1 | grep txt
systemd 1 root txt REG 252,1 1595792 927033 /lib/systemd/systemd
Run Code Online (Sandbox Code Playgroud)
所以,我的问题是:
为什么 Ubuntu 18.04 使用 …