*BSD News Article 14692


Return to BSD News archive

Xref: sserve comp.os.386bsd.questions:1744 news.software.nn:4208
Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!howland.reston.ans.net!usc!sol.ctr.columbia.edu!ira.uka.de!Germany.EU.net!news.Hamburg.Germany.EU.net!abqhh!encap.hanse.de!not-for-mail
From: maverick@encap.hanse.de (Jan-Oliver Neumann)
Newsgroups: comp.os.386bsd.questions,news.software.nn
Subject: Re: nnmaster dies from /etc/rc
Date: 19 Apr 1993 14:09:52 +0200
Organization: Hanse Networking e.V., Hamburg, Germany
Lines: 30
Message-ID: <1qu4qg$10d@encap.hanse.de>
References: <C5LJqC.GFH@veda.is> <1qrskj$ctn@werple.apana.org.au>
NNTP-Posting-Host: encap.hanse.de

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