NetBSD-Users archive

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

Re: Daemonizing processes in NetBSD



W dniu 16.02.2021 o 21:55, Bob Proulx pisze:
Bartek Krawczyk wrote:
is there any program in base which allows to daemonize programs which don't
detach from console, don't have any "-daemon" option etc.? There are
sysutils/daemond and sysutils/daemonize in pkgsrc of course but do we have
anything like "daemon" in FreeBSD base?

As a workaround I'm using "&" from /bin/sh at the moment.

What starts the program?  If it is started from a daemon then that
should be enough.  If this is started from a terminal though...  I am
sure you already know all about the issues.

I know you area asking about base so I will avoid all of the possible
suggestions one might add outside of base.  But let me ask a
question.  Is it practical for you to install an additional small
program to meet this need?

Because what you are looking for is the functionality of
https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/plain/sys-utils/setsid.c
compiled and installed.  If you can install one small program then you
would be set.

Oh I should have been more clear from the start. This is for rc.d script for wip/adguardhome. Probably during startup it doesn't really matter, but when I tested it with "service adguardhome onestart" etc. it sticks on the console. I'm not sure installing additional software just for a single rc.d script is a feasible solution. "&" works just fine for now and I noticed it also in other script.

--
Bartek Krawczyk


Home | Main Index | Thread Index | Old Index