When a Unix-like system is shut down normally, e.g. using halt
, shutdown
, poweroff
etc. or the GUI equivalents, it will try to exit all processes gracefully first by emitting a SIGTERM signal to them. After some time it will send SIGKILL to the programs which are still running.
How long is that delay? How much time do programs have to exit gracefully?
If this is different between systems, I'd like to know the specific default setting for Ubuntu server.
EDIT: Is it Systemd's 90s of delay as described here?
Best Answer
Systemd services can specify their own timeout values for startup and shutdown. If it is not specified, the values are set from the systemd configuration files. The default value set in the configuration files is 90 seconds for both startup and shutdown.
From the manual page for systemd.service:
And from the manual page for systemd-system.conf: