Skip to content

PropExecStart argument uncleanIsFailure is named badly #510

@gwenya

Description

@gwenya

The function PropExecStart has an argument uncleanIsFailure of type bool, which is passed into the UncleanIsFailure property of the execStart struct. The name of the argument and property suggests that setting this flag to true leads to unclean exits (i.e. exit code != 0) being treated as failures, and that setting it to false leads to these exit codes being treated as success.
However the opposite is the case: setting the flag to true has the same effect as starting an ExecStart line in a service unit file with -, i.e. the unclean exit is ignored, while setting it to false achieves the default behaviour of unclean exits being treated as failures.
This can be seen in the systemd source code, for example here: https://github.com/systemd/systemd/blob/ab2bc40dcd4e234c50268815eef92421f26199c1/src/run/run.c#L1644

r = sd_bus_message_append(m, "b", arg_ignore_failure);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions