this is test service unit
[Unit]
Description=test service
Requires=test.1.service
[Install]
WantedBy=multi-user.target
[Service]
Type=simple
ExecStart=/root/test.sh
this is test 1 service unit
[Unit]
Description=test 1 service
After=test.service
[Install]
WantedBy=multi-user.target
[Service]
Type=simple
ExecStart=/root/test.11.sh
systemd 文档
我的问题
问题1:test.service 尽然启动成功了,为什么?它依赖 test.1.service,但 test.1.service 会启动失败啊,因为 /root/test.11.sh 脚本不存在。
问题2:如截图systemd文档,Wants=使用了 fail to start,Requires=使用的是fails to activate,这到底有啥区别呢?