How to stop unwanted servrices during boot

Le grand pinguin rm at mh-freiburg.de
Tue Nov 16 17:03:53 UTC 2004


On Tue, Nov 16, 2004 at 05:45:02PM +0100, Wouter Eerdekens wrote:
> On Tue, Nov 16, 2004 at 05:37:38PM +0100, Le grand pinguin wrote:
> > > That's right. The update-rc.d stuff doesn't work across upgrades
> > > of packages (ie. when you remove the samba initscript with this,
> > > an upgrade of the samba package will re-enable the startup script)
> > 
> > Update-rc.d _doesn't_ remove init scripts, it does remove the symlinks.
> 
> That's what I meant. Sorry 'bout that.

Yes, but this makes a hell of a difference. While the _links_ are
handled by the package installation the init files are (as per
Debian Policy Manual) configuration files, so any changes to the
will be honored by the installation/update (usually by asking whether
the local version should be kept or the new version installed).

> > Autsch, that hurts! The canonical way of configuring this would
> > be by mens of '/etc/defaults/<servicename>'. Many services do
> > have an option to enable/disable startup in this file (for example:
> > apache2 has a 'NO_START=1').
> 
> To be picky, it would be the Debian way :-) But I know what you mean.
> The problem is that not all services have this, and that the option is
> not the same everywhere (ie. some services may have a DISABLED=1 option).
> SSH for example checks for a file called
> 
> /etc/ssh/sshd_not_to_be_run
> 
> to see whether it should start or not. There's simply no standard here.
> 
> And the chmod 'hack' is mentioned in the wiki package posted here
> earlier... So lots of people will be doing this by regarding stuff in the
> wiki as semi-official documentation.
> 
> In my opinion the chmod thing is our 'best' option at the moment.

I can't agree here. No installation will catch a missing x-bit on a
init script. A much better way - edit the init.script:

# file samba

STARTUP=0

if [ "$STARTUP" = "0" ]; then
  echo " Not starting samba services. Edit /etc/init.d/samba"
  echo " and set STARTUP=1 if you need this service to run."
  exit 1
fi

If Ubuntu feels explorative one could provide a shell function
check_startup that would do the above (check $STARTUP) so users
would only have to add "STARTUP=0" or "STARTUP=1" to the init script.
Much cleaner (and it barfs out what it's doing and why and how to
change that. Do the same with a changed filesystem attribute).

 RalfD

> Cheers,
> Wouter
> 
> -- 
> Wouter Eerdekens
>                                     "Revenge is a dish best served cold"
> retuow at xs4all.be                             -- Ancient Klingon Proverb
> http://www.haggis.be/




More information about the ubuntu-users mailing list