Gregory P. Smith added the comment:
On POSIX the norm for anything daemonizing itself is to fork() and let the
parent die so that its original process with the child pid has ended. But I'm
used to this being the responsibility of the daemon process. Not the code
launching the daemon.
Eryk Sun added the comment:
I wonder if this should be handled more productively by supporting a `daemon`
parameter. In POSIX, use the double fork technique for creating a daemon
process. In Windows, use DETACHED_PROCESS | CREATE_NEW_PROCESS_GROUP |
CREATE_BREAKAWAY_FROM_JOB. For a daemon