blob: 34970694e2e69e0ec20d8b7af8d2a9460bc84904 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
---
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.
|