NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Daemonizing processes in NetBSD



On Wed, 17 Feb 2021, Bob Proulx wrote:

Starting a new process that does not know how to detach from the
controlling terminal is the point where you either need it to know
how to call setsid(2) or you need something else installed on the
system which knows how to call setsid(2).


The BSDs (and also Linux) have long had a daemon(3) library function
which does setsid(2) and the other stuff needed to become a
well-behaved daemon. It shouldn't be too hard to make a call in
your program, or to write a wrapper (or port FreeBSD's daemon(8))
for programs which can't be modified.

-RVP


Home | Main Index | Thread Index | Old Index