home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.unix.misc:4051 comp.unix.questions:12959 comp.unix.programmer:5170
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!sun-barr!cs.utexas.edu!ut-emx!ibmchs!auschs!awdprime.austin.ibm.com!ravikm
- From: ravikm@austin.ibm.com (Ravi K Mandava)
- Newsgroups: comp.unix.misc,comp.unix.questions,comp.unix.programmer,ncr.sys.unix
- Subject: Re: Daemons must never die
- Message-ID: <1992Nov5.151918.4388@awdprime.austin.ibm.com>
- Date: 5 Nov 92 15:19:18 GMT
- References: <10114@ncratl.AtlantaGA.NCR.COM> <id.JVJU.413@ferranti.com> <1992Nov1.114010.464@global.hacktic.nl>
- Sender: news@awdprime.austin.ibm.com (USENET News)
- Reply-To: ravikm@piobe.austin.ibm.com
- Organization: IBM Austin
- Lines: 13
- Originator: ravikm@piobe.austin.ibm.com
-
-
- In article <1992Nov1.114010.464@global.hacktic.nl>, peter@global.hacktic.nl (Peter Busser) writes:
- > My question is: do (most) daemons just fork+parent exit/child goes on, or what?
-
- One standard trick is to check if the daemon was started by 'init'
- (getppid() == 1), and if so, do not perform any of those tasks such as
- fork()ing, disassociating the controlling tty (setpgrp()/ioctl()), etc.
- These tasks are also not done in cases where source control (foreground
- debugging) is desired.
- --
- *******************************************************************************
- Ravi K Mandava email: piobe!ravikm@ibmpa.awdpa.ibm.com
- *******************************************************************************
-