--- tags: - systemd - restart references: - https://www.reddit.com/r/linuxquestions/comments/10eu3i0/does_systemctl_restart_send_sigterm_signal/?rdt=64556 --- By default, `restart` does exactly the same thing as `stop` followed by `start`. `stop` will: - execute `ExecStop=` commands, if any; - send the signal defined by `KillSignal=` (default: `SIGTERM`), to any remaining processes identified by the `KillMode=`; - send `SIGCONT` to those same processes; - if `SendSIGHUP=` is true (default: false), send `SIGHUP` to those same processes; - if `SendSIGKILL=` is true (default: true), and any processes remain after `TimeoutStopSec=`, send the `FinalKillSignal=` (default: `SIGKILL`) to those remaining processes; - execute `ExecStopPost=` commands, if any. `restart` changes this by using `RestartKillSignal=` instead of `KillSignal=`, but if `RestartKillSignal=` is not set it just inherits its value from `KillSignal=`. And, of course, `restart` then performs all the regular `start` actions after everything else. `restart` also differs from `stop` by not flushing the file descriptor store associated with the service.