More details on the verification of test package from Launchpad PPA)
---

Test-case)

$ cat <<EOF | sudo tee /etc/systemd/system/fail-on-restart.service
[Service]
ExecStart=/bin/false
Restart=always
EOF


Before) "Active: inactive (dead)"

$ dpkg -s systemd | grep Version
Version: 229-4ubuntu21.4

$ sudo systemctl daemon-reload

$ sudo systemctl start fail-on-restart

$ systemctl status -n0 fail-on-restart
● fail-on-restart.service
   Loaded: loaded (/etc/systemd/system/fail-on-restart.service; static; vendor 
preset: enabled)
   Active: inactive (dead)

$ journalctl --no-pager -u fail-on-restart
<...>
Sep 29 10:59:00 havers systemd[1]: Started fail-on-restart.service.
Sep 29 10:59:00 havers systemd[1]: fail-on-restart.service: Main process 
exited, code=exited, status=1/FAILURE
Sep 29 10:59:00 havers systemd[1]: fail-on-restart.service: Unit entered failed 
state.
Sep 29 10:59:00 havers systemd[1]: fail-on-restart.service: Failed with result 
'exit-code'.
Sep 29 10:59:00 havers systemd[1]: fail-on-restart.service: Service hold-off 
time over, scheduling restart.
Sep 29 10:59:00 havers systemd[1]: Stopped fail-on-restart.service.
Sep 29 10:59:00 havers systemd[1]: Started fail-on-restart.service.
Sep 29 10:59:00 havers systemd[1]: fail-on-restart.service: Main process 
exited, code=exited, status=1/FAILURE
Sep 29 10:59:00 havers systemd[1]: fail-on-restart.service: Unit entered failed 
state.
Sep 29 10:59:00 havers systemd[1]: fail-on-restart.service: Failed with result 
'exit-code'.
Sep 29 10:59:00 havers systemd[1]: fail-on-restart.service: Service hold-off 
time over, scheduling restart.
Sep 29 10:59:00 havers systemd[1]: Stopped fail-on-restart.service.
Sep 29 10:59:00 havers systemd[1]: Started fail-on-restart.service.
Sep 29 10:59:00 havers systemd[1]: fail-on-restart.service: Main process 
exited, code=exited, status=1/FAILURE
Sep 29 10:59:00 havers systemd[1]: fail-on-restart.service: Unit entered failed 
state.
Sep 29 10:59:00 havers systemd[1]: fail-on-restart.service: Failed with result 
'exit-code'.
Sep 29 10:59:00 havers systemd[1]: fail-on-restart.service: Service hold-off 
time over, scheduling restart.
Sep 29 10:59:00 havers systemd[1]: Stopped fail-on-restart.service.
Sep 29 10:59:00 havers systemd[1]: Started fail-on-restart.service.
Sep 29 10:59:00 havers systemd[1]: fail-on-restart.service: Main process 
exited, code=exited, status=1/FAILURE
Sep 29 10:59:00 havers systemd[1]: fail-on-restart.service: Unit entered failed 
state.
Sep 29 10:59:00 havers systemd[1]: fail-on-restart.service: Failed with result 
'exit-code'.
Sep 29 10:59:00 havers systemd[1]: fail-on-restart.service: Service hold-off 
time over, scheduling restart.
Sep 29 10:59:00 havers systemd[1]: Stopped fail-on-restart.service.
Sep 29 10:59:01 havers systemd[1]: Started fail-on-restart.service.
Sep 29 10:59:01 havers systemd[1]: fail-on-restart.service: Main process 
exited, code=exited, status=1/FAILURE
Sep 29 10:59:01 havers systemd[1]: fail-on-restart.service: Unit entered failed 
state.
Sep 29 10:59:01 havers systemd[1]: fail-on-restart.service: Failed with result 
'exit-code'.
Sep 29 10:59:01 havers systemd[1]: fail-on-restart.service: Service hold-off 
time over, scheduling restart.
Sep 29 10:59:01 havers systemd[1]: Stopped fail-on-restart.service.
Sep 29 10:59:01 havers systemd[1]: fail-on-restart.service: Start request 
repeated too quickly.
Sep 29 10:59:01 havers systemd[1]: Failed to start fail-on-restart.service.


Package from PPA)

$ sudo add-apt-repository ppa:mfo/sf199312
$ sudo apt-get update
$ sudo apt-get install systemd


After) "Active: failed (Result: start-limit-hit)"

$ dpkg -s systemd | grep Version
Version: 229-4ubuntu21.4+1.sf199312.20180928

$ sudo systemctl daemon-reload

$ sudo systemctl start fail-on-restart

$ systemctl status -n0 fail-on-restart
● fail-on-restart.service
   Loaded: loaded (/etc/systemd/system/fail-on-restart.service; static; vendor 
preset: enabled)
   Active: failed (Result: start-limit-hit) since Sat 2018-09-29 11:01:34 UTC; 
4s ago
  Process: 7066 ExecStart=/bin/false (code=exited, status=1/FAILURE)
 Main PID: 7066 (code=exited, status=1/FAILURE)

$ journalctl --no-pager -u fail-on-restart
<...>
Sep 29 11:01:33 havers systemd[1]: Started fail-on-restart.service.
Sep 29 11:01:33 havers systemd[1]: fail-on-restart.service: Main process 
exited, code=exited, status=1/FAILURE
Sep 29 11:01:33 havers systemd[1]: fail-on-restart.service: Unit entered failed 
state.
Sep 29 11:01:33 havers systemd[1]: fail-on-restart.service: Failed with result 
'exit-code'.
Sep 29 11:01:33 havers systemd[1]: fail-on-restart.service: Service hold-off 
time over, scheduling restart.
Sep 29 11:01:33 havers systemd[1]: Stopped fail-on-restart.service.
Sep 29 11:01:33 havers systemd[1]: Started fail-on-restart.service.
Sep 29 11:01:33 havers systemd[1]: fail-on-restart.service: Main process 
exited, code=exited, status=1/FAILURE
Sep 29 11:01:33 havers systemd[1]: fail-on-restart.service: Unit entered failed 
state.
Sep 29 11:01:33 havers systemd[1]: fail-on-restart.service: Failed with result 
'exit-code'.
Sep 29 11:01:33 havers systemd[1]: fail-on-restart.service: Service hold-off 
time over, scheduling restart.
Sep 29 11:01:33 havers systemd[1]: Stopped fail-on-restart.service.
Sep 29 11:01:34 havers systemd[1]: Started fail-on-restart.service.
Sep 29 11:01:34 havers systemd[1]: fail-on-restart.service: Main process 
exited, code=exited, status=1/FAILURE
Sep 29 11:01:34 havers systemd[1]: fail-on-restart.service: Unit entered failed 
state.
Sep 29 11:01:34 havers systemd[1]: fail-on-restart.service: Failed with result 
'exit-code'.
Sep 29 11:01:34 havers systemd[1]: fail-on-restart.service: Service hold-off 
time over, scheduling restart.
Sep 29 11:01:34 havers systemd[1]: Stopped fail-on-restart.service.
Sep 29 11:01:34 havers systemd[1]: Started fail-on-restart.service.
Sep 29 11:01:34 havers systemd[1]: fail-on-restart.service: Main process 
exited, code=exited, status=1/FAILURE
Sep 29 11:01:34 havers systemd[1]: fail-on-restart.service: Unit entered failed 
state.
Sep 29 11:01:34 havers systemd[1]: fail-on-restart.service: Failed with result 
'exit-code'.
Sep 29 11:01:34 havers systemd[1]: fail-on-restart.service: Service hold-off 
time over, scheduling restart.
Sep 29 11:01:34 havers systemd[1]: Stopped fail-on-restart.service.
Sep 29 11:01:34 havers systemd[1]: Started fail-on-restart.service.
Sep 29 11:01:34 havers systemd[1]: fail-on-restart.service: Main process 
exited, code=exited, status=1/FAILURE
Sep 29 11:01:34 havers systemd[1]: fail-on-restart.service: Unit entered failed 
state.
Sep 29 11:01:34 havers systemd[1]: fail-on-restart.service: Failed with result 
'exit-code'.
Sep 29 11:01:34 havers systemd[1]: fail-on-restart.service: Service hold-off 
time over, scheduling restart.
Sep 29 11:01:34 havers systemd[1]: Stopped fail-on-restart.service.
Sep 29 11:01:34 havers systemd[1]: fail-on-restart.service: Start request 
repeated too quickly.
Sep 29 11:01:34 havers systemd[1]: Failed to start fail-on-restart.service.
Sep 29 11:01:34 havers systemd[1]: fail-on-restart.service: Unit entered failed 
state.
Sep 29 11:01:34 havers systemd[1]: fail-on-restart.service: Failed with result 
'start-limit-hit'.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1795658

Title:
  xenial systemd reports 'inactive' instead of 'failed' for service
  units that repeatedly failed to restart / failed permanently

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1795658/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to