Bug 651797 - systemd does not allow ExecStartPre scripts to fail
Summary: systemd does not allow ExecStartPre scripts to fail
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: rawhide
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ---
Assignee: Lennart Poettering
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-11-10 10:13 UTC by Jon Masters
Modified: 2010-11-11 06:45 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-11-11 06:45:22 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

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


Note You need to log in before you can comment on or make changes to this bug.