<?xml version="1.0" encoding="utf-8"?><!DOCTYPE article  PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'  'http://www.docbook.org/xml/4.4/docbookx.dtd'><article><articleinfo><title>DisablingAutoBackgrounding</title><revhistory><revision><revnumber>3</revnumber><date>2013-01-14 09:22:09</date><authorinitials>ClintonEbadi</authorinitials><revremark>cat / needs work</revremark></revision><revision><revnumber>2</revnumber><date>2008-07-07 04:28:20</date><authorinitials>localhost</authorinitials><revremark>converted to 1.6 markup</revremark></revision><revision><revnumber>1</revnumber><date>2008-06-04 15:34:10</date><authorinitials>AdamMegacz</authorinitials></revision></revhistory></articleinfo><para>Many daemons &quot;auto-background&quot; themselves. </para><para>Technically this is accomplished by having the daemon call <code>setsid()</code>, then <code>fork()</code> and then having the parent <code>exit()</code>.  The result is that the child is re-parented to process 1 (init) and is in its own &quot;session group&quot;. </para><para>Unfortunately this means that a daemon started via <code>k5start</code> which does this is no longer a child of <code>k5start</code>; this means that <code>k5start</code> cannot do its job. </para><para>Here are some hints on how to get various daemons to disable this behavior: </para><section><title>general</title><para>The <code>runit</code> package also needs to disable this behavior, so they've collected a lot of hints <ulink url="http://smarden.org/runit/runscripts.html">here</ulink>. </para></section><section><title>eggdrop</title><para>Pass in the <code>-n</code> argument </para></section><section><title>apache2</title><para>Pass in the <code>-DFOREGROUND</code> argument </para><!--rule (<hr>) is not applicable to DocBook--><para> <ulink url="https://wiki.hcoop.net/DisablingAutoBackgrounding/CategoryNeedsWork#">CategoryNeedsWork</ulink> <ulink url="https://wiki.hcoop.net/DisablingAutoBackgrounding/CategoryMemberManual#">CategoryMemberManual</ulink> </para></section></article>