Consider the following service:
[Unit]
Description=foobar
[Service]
Type=simple
ExecStart=/usr/bin/false
Restart=on-failure
[Install]
WantedBy=multi-user.target
I'd expect it restart a few times, and then quiesce as a failed unit. However, this is what actually happens on systemd 229 with Ubuntu Xenial:
root@monitoring:/etc/systemd/system# systemctl status foobar
● foobar.service - foobar
Loaded: loaded (/etc/systemd/system/foobar.service; disabled; vendor preset:
Active: inactive (dead)
Apr 01 21:08:43 monitoring.ci.ezyang.com systemd[1]: foobar.service: Service hol
Apr 01 21:08:43 monitoring.ci.ezyang.com systemd[1]: Stopped foobar.
Apr 01 21:08:43 monitoring.ci.ezyang.com systemd[1]: Started foobar.
Apr 01 21:08:43 monitoring.ci.ezyang.com systemd[1]: foobar.service: Main proces
Apr 01 21:08:43 monitoring.ci.ezyang.com systemd[1]: foobar.service: Unit entere
Apr 01 21:08:43 monitoring.ci.ezyang.com systemd[1]: foobar.service: Failed with
Apr 01 21:08:44 monitoring.ci.ezyang.com systemd[1]: foobar.service: Service hol
Apr 01 21:08:44 monitoring.ci.ezyang.com systemd[1]: Stopped foobar.
Apr 01 21:08:44 monitoring.ci.ezyang.com systemd[1]: foobar.service: Start reque
Apr 01 21:08:44 monitoring.ci.ezyang.com systemd[1]: Failed to start foobar.
Importantly, it doesn't list as a failed unit in systemctl --failed
, or degrade the status of systemctl status
. Why?