linux – ConditionPathExists =和ConditionPathExists = |之间的区别是什么在systemd?

在Systemd中启动我的服务之前,我需要检查一个文件不存在.我在[单位]中看到两个案例:
ConditionPathExists=!/tmp/abc

ConditionPathExists=|!/tmp/abc

他们一样吗?任何人都可以帮我解释一下他们是不同的吗?

解决方法

有时你指定多个文件,如:
ConditionPathExists=!/tmp/abc
ConditionPathExists=!/tmp/abe

现在如果不满足任何条件,它就不会启动服务.就像和操作一样.

现在,如果您使用:

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

如果满足任何这些条件,它将运行该服务.

Condition checks can be prefixed with a pipe symbol (|) in which case
a condition becomes a triggering condition. 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

这就像OR操作

相关文章

Linux中的ARP防火墙主要用于防御ARP欺骗攻击,其效果取决于多...
insmod和modprobe加-f参数导致Invalid module format错误 这...
将ArchLinux安装到U盘 几个月前入门Arch的时候上网搜了不少安...
1、安装Apache。 1)执行如下命令,安装Apache服务及其扩展包...
一、先说一下用ansible批量采集机器信息的实现办法: 1、先把...
安装配置 1. 安装vsftpd 检查是否安装了vsftpd # rpm -qa | ...