Bug 89840

Summary: RFE: PID1 add ExecFail= option to start executables on service failure
Product: systemd Reporter: Alban Crequy <alban.crequy>
Component: generalAssignee: systemd-bugs
Status: RESOLVED MOVED QA Contact: systemd-bugs
Severity: normal    
Priority: medium CC: jonathanboulle
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Alban Crequy 2015-03-31 14:05:22 UTC
When starting a systemd unit file, it might print the following error based on errno=ENOENT:

testscript[9959]: Failed at step EXEC spawning /testscript: No such file or directory

This could mean /testscript is missing, or ld-2.19.so is missing or the interpreter in the shebang is missing.

But the error message is not precise enough to know. The kernel does not give more details when execve() fails with errno=ENOENT.

In order to print better error messages, we could have an option ExecFail in the unit file:

ExecFail=/usr/bin/diagexec

It would start the diagnostic tool to guess why execve() returned ENOENT.

The code for diagexec is there:

https://github.com/coreos/rocket/blob/master/stage1/rootfs/diagexec/diagexec.c#L58
Comment 1 Alban Crequy 2016-05-03 18:18:25 UTC
Moving discussion to https://github.com/systemd/systemd/issues/3184

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.