Systemd Requires疑惑?

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,这到底有啥区别呢?

阅读 829
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进