[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: The right way to not start daemons



On Thu, Nov 08, 2001 at 04:43:39PM +0100, Andreas Bombe wrote:
> On Tue, Nov 06, 2001 at 08:37:38AM +1100, Herbert Xu wrote:
> > Craig Small <csmall@eye-net.com.au> wrote:
> > 
> > > The point is, should there be a single suggested method that all daemons
> > > use?  I think it would be nice that, for example, a user knew that
> > > putting a file /etc/<package>/no_start_<daemon> worked for most
> > > packages.
> > 
> > Putting an "exit 0" into the init.d script has always worked for me.
> 
> It is suboptimal.  Maybe you don't want the daemon to start at boot but
> you want to start it manually.  You can't use the init script then
> without removing the "exit 0".

You could do something like
if [ -e /etc/nologin ]; then
    exit 0
fi

And, if you want it configurable, make it check some config option (like
no_start_daemon_boot or whatever)

-- 
Peter Mathiasson                 | GPG Fingerprint:
E-Mail: peter@mathiasson.nu      |  A9A7 F8F6 9821 F415 B066
Web   : http://www.mathiasson.nu |  77F1 7FF5 C2E6 7BF2 F228

Attachment: pgpQkoREo6Eui.pgp
Description: PGP signature


Reply to: