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

Re: better make a standard for /etc/*/*_not_to_be_run



Hi,

On Sun, Aug 10, 2003 at 07:30:17AM +0800, Dan Jacobson wrote:

> Just these so far?
> $ ls /etc/*/*_not_to_be_run
> /etc/apache/apache_not_to_be_run  /etc/ssh/sshd_not_to_be_run
> Any more?
> 
> Indeed, there are plenty of packages that I want installed, but that I use
> only once a year or that are controlled by /etc/ppp/ip-*, thus I don't
> want them started each boot.
> 
> zgrep not_to_be_run /usr/share/doc/debian-policy/*
> shows nothing.
> 
> Hmmm, better make a standard for it quick.  Should it be
> /etc/$package/${package}_not_to_be_run
> or
> /etc/$package/${package}d_not_to_be_run
> or some entirely different directory:
> /etc/boot_no_run/ etc. etc.
> 
> After you set the policy, then those programs that want to give the
> choice of starting at boot or not would at least have a standard place
> to look for the answer.

Whatever you suggest, it should of course be simple to implement. A
script doesn't know which package it belongs to, so a flag file name
something that contains $package may not be the best choice.

Personally, I like to think that /etc/rc?.d/* is the place to configure
such things. They aren't treated as conffiles for nothing, even more so
for the symlinks. If you don't want something to be run, move S20... to
skip/S20... A more indirect mechanism isn't strictly needed, IMHO.

However, if people think it's valuable, it should be a simple addition
that can be made to any init script. Eg.

script=`readlink -f $0 || echo $0`
[ -f /etc/skip/`basename $script` ] && exit 0

If the script is called from a symlink, the symlink is dereferenced
before testing if /etc/skip contains a file called the same as the
bare file name of the script itself, and if so, the script exits.

So, both /etc/rc2.d/S20lpd and /etc/rc0.d/K20lpd will exit if a file
called /etc/skip/lpd exists, because both of those files are symlinks
pointing to /etc/init.d/lpd.

Is that an idea?

The following line could be added to allow not just the admin, but also
programs to suppress each other's automatic startup and shutdown:

[ -f /var/skip/`basename $script` ] && exit 0

Cheers,


Emile.

-- 
E-Advies - Emile van Bergen           emile@e-advies.nl      
tel. +31 (0)70 3906153           http://www.e-advies.nl    



Reply to: