What is the difference between ConditionPathExists = and ConditionPathExists = | in systemd?

I need to verify that the file does not exist before I start my service in Systemd. I see two cases in [Unit]:

ConditionPathExists=!/tmp/abc 

and

 ConditionPathExists=|!/tmp/abc 

they are the same? Can someone help me explain if they are different?

+4
source share
1 answer

Sometimes you specify several files, for example:

 ConditionPathExists=!/tmp/abc ConditionPathExists=!/tmp/abe 

Now, if any condition is not met, it does not start. It likes and works.

Now if you use:

 ConditionPathExists=|!/tmp/abc ConditionPathExists=|!/tmp/abe 

If any of these conditions are met, it will start the service.

The condition check may have a pipe symbol prefix (|), in which case the condition becomes a trigger condition. If at least one start condition is defined for one, then the block will be executed if at least one of the start conditions is applied, and all conditions without start

It's like an OR operation

+7
source

All Articles