output of invoke-rc.d for systemd units un-debuggable on failure
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
init-system-helpers (Ubuntu) |
Fix Released
|
Wishlist
|
Martin Pitt | ||
Xenial |
Fix Released
|
Wishlist
|
Steve Langasek |
Bug Description
[SRU Justification]
Currently if a systemd unit fails to start in a non-interactive upgrade and all you have is a log, it's impossible to debug. Fix this so that logs contain the actual details of the unit failure.
[Test case]
1. Get a root shell.
2. Run "sed -e's,sbin/
3. Run 'systemctl enable ssh-noexists'
4. Run 'ln -s ../init.d/ssh /etc/rc5.
5. Run 'invoke-rc.d ssh-noexists start'
6. Verify that the command directs you to run 'systemctl status' for details, and provides no details.
7. Install init-system-helpers from -proposed.
8. Run 'invoke-rc.d ssh-noexists start'.
9. Verify that the command provides details about the failure to start ssh-noexists service.
10. Run 'systemctl disable ssh-noexists'.
11. Run 'rm -f /lib/systemd/
12. Run 'rm -f /etc/rc5.
[Regression potential]
Minimal. On the failure case, an additional command is run; the additional command is guarded with || true.
[Original description]
When invoke-rc.d is called on a systemd system, if the unit fails to start, you get output like:
Created symlink /etc/systemd/
Job for openafs-
See "systemctl status openafs-
invoke-rc.d: initscript openafs-fileserver, action "start" failed.
dpkg: error processing package openafs-fileserver (--configure):
subprocess installed post-installation script returned error exit status 1
The output shown here comes from systemctl itself, and is usually fine. The admin who ran systemctl can run those other commands to debug.
However, when called by invoke-rc.d, this output is usually seen only in a log file; maybe submitted in a bug report, maybe attached to something like an autopkgtest:
By the time someone looks at this log output, it is often too late to run those commands in order to debug the failure.
invoke-rc.d should call these commands for us on systemd unit failure, so that the relevant debugging information is included in the log where it can help.
We don't want to call 'journalctl -xe', which might leak information into the log from other jobs, but 'journalctl -x -u <this_unit>' may be appropriate.
Changed in init-system-helpers (Ubuntu): | |
assignee: | nobody → Martin Pitt (pitti) |
tags: | added: server-next |
Changed in init-system-helpers (Ubuntu Xenial): | |
assignee: | Martin Pitt (pitti) → nobody |
description: | updated |
description: | updated |
Changed in init-system-helpers (Ubuntu Xenial): | |
assignee: | nobody → Steve Langasek (vorlon) |
status: | Triaged → In Progress |
description: | updated |
tags: |
added: verification-done removed: removal-candidate verification-needed |
Seems fine to me at first sight. I'd vote for "systemctl status", as that also shows running and exited services with exit codes etc., and the journal tail. We have this shiny new technology now, so let's use it :-)
Just checking with the other init folks.