> We’ll go into the SysV recommendation of “double forking”
SysV init can not handle daemons that double-fork. Neither could BSDs up until somewhat recently. Just let your systems "service manager" deal with that on your own, seriously: don't reimplement this functionality; one program to do one thing, etc.
These days I've been using the `daemon` utility in FreeBSD whenever I need to run some long running program as a daemon. This allows me to not even bother with flags, double forks and so on.
> We’ll go into the SysV recommendation of “double forking”
SysV init can not handle daemons that double-fork. Neither could BSDs up until somewhat recently. Just let your systems "service manager" deal with that on your own, seriously: don't reimplement this functionality; one program to do one thing, etc.
These days I've been using the `daemon` utility in FreeBSD whenever I need to run some long running program as a daemon. This allows me to not even bother with flags, double forks and so on.