【发布时间】:2017-07-31 13:58:56
【问题描述】:
我有 2 个服务 a.service 和 b.service。 a.service 显示
[Unit]
Description=My service
[Service]
Type=forking
ExecStart=/bin/sh /home/admin/run.sh
Restart=on-failure
[Install]
WantedBy=multi-user.target,
b.服务
[Unit]
Description=My service
[Service]
Type=forking
ExecStart=/bin/sh $HOME/theFolder/run.sh
Restart=on-failure
[Install]
WantedBy=multi-user.target
现在,当我启动 b.service 时,我确定 a.service 会启动。 在运行时,突然有人弄乱了 /home/admin/run.sh 并且 systemd 无法启动 a.service (也 systemctl status a.service 显示为失败状态)。现在有一个选项可以让 b.service 知道 a.service 失败并且应该停止/退出?
【问题讨论】:
-
BindsTo=a.service
标签: linux service systemd watchdog systemctl