[systemd-devel] Antw: Re: Q: ConditionPathExists=

Ulrich Windl Ulrich.Windl at rz.uni-regensburg.de
Tue Jun 4 12:17:01 UTC 2019


>>> Reindl Harald <h.reindl at thelounge.net> schrieb am 04.06.2019 um 13:51 in
Nachricht <e033c37e-6530-9c15-5383-31cd6290eee5 at thelounge.net>:

> 
> 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

because for other statements it's equivaluent to write
Bla=Foo
Bla=Bar

and "Bla=Foo Bar"

> 
>> 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"

I did read that, but that doesn't answer where to put the pipe.

> 
> 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

I don't know the parser.

> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org 
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel 






More information about the systemd-devel mailing list