This is the correct answer -- when you fork the process yourself, you don't have to guess about it dying, you get SIGCHLD and can handle it accordingly.
If you use daemontools, this code is already written for you.
If you use daemontools, this code is already written for you.
Still, I think they're doing it wrong. For keeping daemons alive I rely on http://cr.yp.to/daemontools.html .