systemd是否支持for-failure重新启动forking守护进程?

时间:2017-07-10 16:00:50

标签: linux daemon systemd

假设我的systemd单元文件中包含以下内容:

Type=forking
Restart=on-failure

父进程退出,状态为0(子启动成功)。在稍后的某个时刻,孩子死于非零状态。怎么了? systemd可以跟踪子守护进程PID:

Process: 1768 ExecStart=/bin/mydaemon (code=exited, status=0/SUCCESS)
Main PID: 1770 (mydaemon)

是"重启=失败"只查看父退出状态,还是孩子?

1 个答案:

答案 0 :(得分:0)

简短回答:是的,它可以按照人们的预期运作。

完全回答感谢@thecarpy over Unix& Linux Stack Exchange:https://unix.stackexchange.com/questions/377530/does-systemd-support-on-failure-restarts-for-forking-daemons