How to skip the 90s timeout in systemd

systemdsystemd-boot

Is it possible to interactively skip the 90s timeout in systemd? For example, when it is waiting for a disk to become available or user to log out? I know it will fail eventually, so can I just make it fail now? I hate just staring at the screen helplessly.

Best Answer

You have two options:

  1. You can set TimeoutStopSpec= on a specific UNIT to a specific value (in seconds*) to wait. You can also set it to infinity in which case SIGKILL will never be sent (not recommended as you may end up with runaway services that are hard to debug).

  2. Set DefaultTimeoutStopSec= inside /etc/systemd/system.conf (or user.conf, or in one of the *.d directories) to a default value that all UNITs that do not have TimeoutStopSpec= specified will use. The deafult for this setting is the 90s you normally see.

Man page references:

  • man systemd.service for TimeoutStopSpec=
  • man systemd-system.conf for DefaultTimeoutStopSec=

* systemd also accepts time specs, e.g. "2min 3s". That's extensively described in the man.

Related Question