如何systemd处理托管进程的子进程的死亡?
假设systemd启动守护进程foo,然后启动其他三个守护进程:bar1,bar2,和bar3。systemd对fooifbar2意外终止会做些什么吗?根据我的理解,foo如果您没有startd通过更改属性进行其他说明,则在 Solaris 上的服务管理工具 (SMF) 下将被终止或重新启动ignore_error。难道systemd不同的表现?
编辑#1:
我编写了一个测试守护进程来测试systemd的行为。守护进程被调用mother_daemon是因为它产生子进程。
#include <iostream>
#include <unistd.h>
#include <string>
#include <cstring>
using namespace std;
int main(int argc, char* argv[])
{
cout << "Hi! I'm going to fork and make 5 child processes!" << endl;
for (int i = 0; i < 5; i++)
{
pid_t …Run Code Online (Sandbox Code Playgroud)