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

Re: Daemon init scripts and apt-get [was: Re: red worm amusement]



>On Sat, Jul 21, 2001 at 11:59:17PM -0700, Mike Fedyk wrote:
>  Personally, I think there should either be a /etc/do-not-start/<package> dir that
>  packages' init scripts check for non-existance before starting, or a
>  commented entry in the config file that the init script checks for
>  non-existance before starting...
> 

>On Sun, Jul 22, 2001 at 03:27:10AM -0400, Steven Barker wrote:
> Well, now we're getting into heavy policy stuff....  I think it would be hard
> enough to get all the daemon postinst scripts to work in run and no-run mode.

> Mike Fedyk <mfedyk@matchmail.com> writes:
> Actually, if we could get them all to source an sh script that
> contains that logic, all changes to policy would be self-contained.

On Wed, Jul 25, 2001 at 11:05:25AM -0700, Dale Southard wrote:
> 
> I think I've shot this one out before, but...
> 
> Why not use something like the IRIX ``chkconfig'' system: Provide a
> simple program that takes the ``name'' of a service and then checks an
> external file/files for ``on'' or off status of each service, and
> returns 0 if on, 1 if off.  Then have each init.d script do something
> like:
> 
>   case "$1" in
>     'start')
>       if /etc/chkconfig myservice; then
>         ...
>         start myservice
>         ...
>       fi
>

Very nice, even better than sourcing...

Though, source <file> is a one line change, and doesn't add logic to
each package.  But, that could lead to another flame war on what should
go in that sourced file...

> [In IRIX, the /etc/config directory has a file for each name chkconfig
> knows about that contains either ``on'' or ``off'' so adding a new
> service is as simple as `echo "on" > /etc/config/newservice`, though
> IRIX actually allows viewing and changing things with the chkconfig
> program itself (eg, `chkconfig` with no arguments lists every service
> known to chkconfig, `chkconfig service on|off` changes the state of a
> service, with a -f flag to ``force'' creation of a new service.)]
>
> This prevents ``uptdate surprises'' since updating everything
> including the init.d script doesn't change the on|off status of the
> service in the config directory.  Of course it also means putting the
> above bit of logic in every init.d script that is put under chkconfig
> control and adding the necessary logic to the postinst script to
> create the config entry if it doesn't exist yet...

I think we would probably default to "off" if there isn't a file, or
if it doesn't contain "on".  That way, all you have to do is touch the
file on install...

Mike



Reply to: