我有 2 项服务 a.service 和 b.service。a. 显示服务
[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 失败并且应该停止/退出?