🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nn
Article #4071

Re: nnmaster dies from /etc/rc

#4071
From: Jan-Oliver Neumann
Date: Mon, 19 Apr 1993 12:09
30 lines
2006 bytes
andrew@werple.apana.org.au (Andrew Herbert) writes:

>adam@veda.is (Adam David) writes:

>>386bsd 0.1.2.2, nn 6.4.18

>>Why does 'nnmaster -r -C' die when called from /etc/rc.local but runs normally
>>in daemon mode when typed by root?

>From memory, because init doesn't open file descriptor 0 (stdio would quite
>like it to be connected to /dev/null).  Try running it from /etc/rc with
>like this:

>nnmaster -r -C </dev/null

>Even better, fix the DETATCH_TERMINAL (!) macro in conf/s-whatever.h to say
>"setsid();" rather than what appears in s-bsd4-2.h.

Well, I haven't tried the solution above, but I replaced the lines in 
master.c that fork the master into the background by a call to the daemon()
function from the libutil. This is what all the standard daemons do.
Just call daemon(0,0); and the master does not die. It has even a ?? in the
ps-field TT like all the other working daemons.
You have to link the master with the libutil then, of course.

Kind regards, Jan-Oliver
-- 
Jan-Oliver Neumann                                     <maverick@encap.hanse.de>
Gegen Rassismus und Extremismus ------------------- Against racism and extremism
XXXXXXXXXXXXXXXXXXXXX Kopiere mich in deine Signature XXXXXXXXXXXXXXXXXXXXXXXXXX
Technical Details
Message-ID: <1qu4qg$10d@encap.hanse.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.nn.mbox.zip!gmd.de!ira.uka.de!Germany.EU.net!news.Hamburg.Germany.EU.net!abqhh!encap.hanse.de!not-for-mail
References: <C5LJqC.GFH@veda.is> <1qrskj$ctn@werple.apana.org.au>

Show Full Headers
Complete Article Headers
Message-ID: <1qu4qg$10d@encap.hanse.de>
Subject: Re: nnmaster dies from /etc/rc
Date: Mon, 19 Apr 1993 12:09:52 +0000
From: maverick@encap.hanse.de (Jan-Oliver Neumann)
References: <C5LJqC.GFH@veda.is> <1qrskj$ctn@werple.apana.org.au>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.nn.mbox.zip!gmd.de!ira.uka.de!Germany.EU.net!news.Hamburg.Germany.EU.net!abqhh!encap.hanse.de!not-for-mail
Newsgroups: comp.os.386bsd.questions,news.software.nn
Organization: Hanse Networking e.V., Hamburg, Germany
Lines: 30
NNTP-Posting-Host: encap.hanse.de