home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / unix / misc / 4051 < prev    next >
Encoding:
Internet Message Format  |  1992-11-06  |  1.4 KB

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