Bug 651797

Summary: systemd does not allow ExecStartPre scripts to fail
Product: [Fedora] Fedora Reporter: Jon Masters <jcm>
Component: systemdAssignee: Lennart Poettering <lpoetter>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: jcm, lpoetter, metherid, mschmidt, notting, plautrba
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-11-11 06:45:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jon Masters 2010-11-10 10:13:24 UTC
Description of problem:

I need to call something in ExecStartPre that I know will fail. But if I do this, it seems that systemd will assume the whole thing failed. I know the return is going to be a failure, but that is what I want. How do I do this?

Jon.

Comment 1 Jon Masters 2010-11-10 10:36:01 UTC
I will add that I only need this temporarily, and I have found another solution for the moment (having systemd call a ExecStartPre script that calls what I want and then always gives systemd an "exit 0") so don't go crazy fixing it if you don't have time. I should not even need the pre script soon. But still, I suspect someone else is going to need to do something similar at some point.

Apologies if this is /really/ simply done, I'm still learning the systemd service syntax and just made my first systemd-enabled package.

Jon.

Comment 2 Michal Schmidt 2010-11-11 06:45:22 UTC
If you prepend the path with a dash the result will be ignored:
ExecStartPre=-/bin/false