无法删除sysemd单元文件中的locking文件

我在RHEL7系统上遇到了一个非常奇怪的问题。/run/puppetboot.lock文件在单元文件执行结束时没有被删除。 奇怪的是,当我用'/ usr / bin / true'replace'puppet agent'行时,那么它们的locking文件就会按预期被删除。

[Unit] Description=Extra Puppet runs Wants=basic.target Before=puppet.service After=basic.target network.target puppetmaster.service [Service] Type=oneshot RemainAfterExit=yes EnvironmentFile=-/etc/sysconfig/puppetagent EnvironmentFile=-/etc/sysconfig/puppet ExecStart=/usr/bin/touch /run/puppetboot.lock ExecStart=/usr/bin/puppet agent --onetime --no-daemonize --ignoreschedules ExecStart=/usr/bin/puppet agent --onetime --no-daemonize --ignoreschedules ExecStart=/usr/bin/rm -f /run/puppetboot.lock ExecStart=/bin/bash -c "/bin/test -x /usr/local/sbin/reboot-if-needed && /usr/local/sbin/reboot-if-needed" [Install] WantedBy=multi-user.target puppet.service 

我使用locking文件作为早期启动configuration和设置完成的信号,以便我可以向pipe理员发送电子邮件以进行构build后configuration。 我希望避免添加一个systemd单元文件只是为了在build立新的服务器之后向我发送警告邮件。