How to Spawn Child Processes that Don't Die with Parent?

前端 未结 6 1234
说谎
说谎 2021-01-18 11:09

I have a C++ program that acts as a watchdog over others. If it detects that a process is no longer running, it restarts it via system. The problem is, if I kil

6条回答
  •  自闭症患者
    2021-01-18 11:30

    There's an execvp example in https://github.com/w-A-L-L-e/wash/blob/master/src/wash.cpp. Passing command line args is sometimes an issue with exec* functions from unistd and getting the environment passed can be some work. Anyway, hope it helps...

提交回复
热议问题