The point here is that SystemD’s natural behavior is to send SIGTERM then wait an eternity.
Those “service XY is shutting down (5sec/2min)” messages you sometimes get on shutdown are coming from SystemD not waiting for 3 seconds like the meme suggests, but waiting for minutes before giving up and switching over to SIGKILL instead.
There is the option to explicitly set DefaultTimeoutStartSec and DefaultTimeoutStopSec per systemd service.
If you don’t specify it in a service file, the default values from /etc/systemd/system.conf (both set to 90s) will be used, so you can change those values to 30s, too, to affect all services (that don’t have their limit set explicitly) globally.
The point here is that SystemD’s natural behavior is to send SIGTERM then wait an eternity.
Those “service XY is shutting down (5sec/2min)” messages you sometimes get on shutdown are coming from SystemD not waiting for 3 seconds like the meme suggests, but waiting for minutes before giving up and switching over to SIGKILL instead.
Can I somehow set this timer to thirty seconds instead of three minutes and up?
There is the option to explicitly set
DefaultTimeoutStartSecandDefaultTimeoutStopSecper systemd service.If you don’t specify it in a service file, the default values from
/etc/systemd/system.conf(both set to 90s) will be used, so you can change those values to 30s, too, to affect all services (that don’t have their limit set explicitly) globally.