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
You may be interested by the daemon(3) library function (internally using two nested fork(2) syscalls). After that, use the relevant execve(2) syscall (or related exec(3) functions)...
You should read Advanced Linux Programming for more.