当你去看婚礼
$ pstree -g 2 -p $ | sed "s/$USER/me/g"
─┬◆ 00001 root /sbin/launchd
└─┬◆ 00277 me /Applications/Utilities/Terminal.app/Contents/MacOS/Terminal -psn_0_40970
└─┬◆ 00360 root login -pfl me /bin/bash -c exec -la bash /usr/local/bin/bash
└─┬◆ 00368 me -bash
├─┬◆ 03968 me pstree -g 2 -p 368
│ └─── 03970 root ps -axwwo user,pid,ppid,pgid,command
└─── 03969 me sed s/me/me/g我发现root /sbin/launchd是0001进程,是否意味着/sbin/launchd在开机后立即运行?
发布于 2018-11-10 02:26:58
是。PID 1在启动后立即运行,无法退出。如果它退出,它将触发内核恐慌。
https://unix.stackexchange.com/questions/480880
复制相似问题