Fixes #16401. c80a9a33d04fb4381327a69ce929c94a9f1d0e6c introduced the .can_fail field, but didn't set it on .targets. Targets can fail through dependencies. This leaves .slice and .device units as the types that cannot fail. $ systemctl cat bad.service bad.target bad-fallback.service [Service] Type=oneshot ExecStart=false [Unit] OnFailure=bad-fallback.service [Service] Type=oneshot ExecStart=echo Fixing everythign! $ sudo systemctl start bad.target systemd[1]: Starting bad.service... systemd[1]: bad.service: Main process exited, code=exited, status=1/FAILURE systemd[1]: bad.service: Failed with result 'exit-code'. systemd[1]: Failed to start bad.service. systemd[1]: Dependency failed for bad.target. systemd[1]: bad.target: Job bad.target/start failed with result 'dependency'. systemd[1]: bad.target: Triggering OnFailure= dependencies. systemd[1]: Starting bad-fallback.service... echo[46901]: Fixing everythign! systemd[1]: bad-fallback.service: Succeeded. systemd[1]: Finished bad-fallback.service.
System and Service Manager
Details
Most documentation is available on systemd's web site.
Assorted, older, general information about systemd can be found in the systemd Wiki.
Information about build requirements is provided in the README file.
Consult our NEWS file for information about what's new in the most recent systemd versions.
Please see the Hacking guide for information on how to hack on systemd and test your modifications.
Please see our Contribution Guidelines for more information about filing GitHub Issues and posting GitHub Pull Requests.
When preparing patches for systemd, please follow our Coding Style Guidelines.
If you are looking for support, please contact our mailing list or join our IRC channel.
Stable branches with backported patches are available in the stable repo.