Bug 89840 - RFE: PID1 add ExecFail= option to start executables on service failure
Summary: RFE: PID1 add ExecFail= option to start executables on service failure
Status: RESOLVED MOVED
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-31 14:05 UTC by Alban Crequy
Modified: 2016-05-03 18:18 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

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.