代码: 全选
cat /lib/systemd/system/motion.service | grep !
ExecStartPre=!/bin/mkdir -p /var/log/motion
ExecStartPre=!/bin/chown motion:adm /var/log/motion
Similar to the "+" character discussed above this permits invoking command lines with elevated privileges. However, unlike "+" the "!" character exclusively alters the effect of User=, Group= and SupplementaryGroups=, i.e. only the stanzas that affect user and group credentials. Note that this setting may be combined with DynamicUser=, in which case a dynamic user/group pair is allocated before the command is invoked, but credential changing is left to the executed process itself.
阅读了,勉强理解了字面含义,还是有点不明白,有哪位再详细解释一下?