I do not understand why
sudo
gets a separate PID (eg 1620) while starting dockerd (eg 1628) with sudo?
It is just the way that sudo
works. It runs the command as a child process because it needs to do things after the child process exits.
You may be able to tweak the sudo
configs to so that sudo
doesn't fork a child process. On my system, man sudo
says:
"If no I/O logging plugins are loaded and the policy plugin has not defined a
close()
function, set a command timeout or required that the command be run in a new pty,sudo
may execute the command directly instead of running it as a child process."
But notice that:
To which PID should I send SIGTERM to stop the dockerd?
You can send signals to the sudo
process and they will be relayed to the dockerd
process. That's what man sudo
says. Look in the man page's section on signal handling.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.