Systemctl service timed out during start

Set the Type of your service script either to simple or oneshot. Depending on the behavior of the shell script that is started.

  • if the shell script runs an endless loop and does not exit, set Type to simple
  • otherwise set Type to oneshot

After you have made your changes reload the configuration with systemctl daemon-reload and start your service.


I also had to add (or was it because I rebooted in the end, and TimeoutSec actually doesn't make a difference?)

TimeoutSec=0

As described in https://bugzilla.redhat.com/show_bug.cgi?id=1446015#c7

The man systemd.service command on my own systems tells me infinity should be used for that. I guess both work.

Like so (Whatever GuessMainPID is, but this is how my currently working file looks like):

/etc/systemd/system/[email protected]

[Service]
Type=simple
TimeoutSec=0
GuessMainPID=false
ExecStart=/bin/bash -c "funny stuff %I"

My service was triggered from an udev rule (as in http://blog.fraggod.net/2012/06/16/proper-ish-way-to-start-long-running-systemd-service-on-udev-event-device-hotplug.html), no Idea if that makes any difference. For anyone wondering how to get the timeout log: I had to run journalctl | tail to see which kinds of errors my udev rule and service just produced.