[systemd-devel] Q: ConditionPathExists=

Reindl Harald h.reindl at thelounge.net
Tue Jun 4 11:51:18 UTC 2019



Am 04.06.19 um 13:32 schrieb Ulrich Windl:
> Hi!
> 
> I have a question for ConditionPathExists:
> If I specify two files like "ConditionPathExists=/etc/idredir.conf /etc/isredir.conf", I get a "start condition failed" even if both files exist.

why don't you just use

ConditionPathExists=/etc/idredir.conf
ConditionPathExists=/etc/isredir.conf

> There's also some confusion where exactly a pipe sysmbol has to be placed:
>            If multiple conditions are specified, the unit will be executed if
>            all of them apply (i.e. a logical AND is applied). Condition checks
>            can be prefixed with a pipe symbol (|) in which case a condition
>            becomes a triggering condition. If at least one triggering
> 
> Do I have to write "|ConditionPathExists=..." or "ConditionPathExists=|..."

ConditionPathExists=|

did you stop to read where you stoped o quote: "If at least one
triggering condition is defined for a unit, then the unit will be
executed if at least one of the triggering conditions apply and all of
the non-triggering conditions"

it's the same logic like ReadOnlyPath=-/whatever to avoid failing if the
path don't exist and make a readonly namespace in case it exists

| or - before an option make sno sense ina INI-syle cofnig


More information about the systemd-devel mailing list