[Pkg-sysvinit-devel] Bug#680293: update-rc.d manual: `update-rc.d remove name` works when `/etc/init.d/name` exists

Paul Menzel pm.debian at googlemail.com
Wed Jul 4 21:00:53 UTC 2012


Am Mittwoch, den 04.07.2012, 21:33 +0100 schrieb Roger Leigh:
> On Wed, Jul 04, 2012 at 10:17:10PM +0200, Paul Menzel wrote:
> > 
> > the manual of `update-rc.d` contains the following paragraph.
> > 
> >         $ man update-rc.d
> >         […]
> >         When invoked with the remove option, update-rc.d removes any
> >         links in the /etc/rcrunlevel.d directories to the
> >         script /etc/init.d/name. The script must have been deleted
> >         already.  If the script is still present then update-rc.d aborts
> >         with an error message.
> >         […]
> 
> This is my understanding.  It should only remove the links if you use
> "-f remove" to force removal.
> 
> > It looks like `update-rc.d remove name` still works though when the
> > script in `/etc/init.d/name` is not removed beforehand.
> > 
> >         $ sudo update-rc.d pulseaudio remove
> >         update-rc.d: using dependency based boot sequencing
> >         $ ls -l /etc/init.d/pulseaudio
> >         -rwxr-xr-x 1 root root 2227  1. Okt 2011  /etc/init.d/pulseaudio
> >         $ ls -l /etc/rc*.d/*audio
> >         ls: Zugriff auf /etc/rc*.d/*audio nicht möglich: Datei oder Verzeichnis nicht gefunden
> >         $ sudo service pulseaudio stop
> >         PulseAudio configured for per-user sessions ... (warning).
> > 
> > Does the manual need updating?
> 
> No, I think the manual is correct and update-rc.d is not behaving as
> documented.

I wonder though, what is the disadvantage of leaving `/etc/init.d/name`
behind and `-f` has to be used to do so?

> Mind you, I've not seen this before.  But I can also reproduce it:
> 
> % ls /etc/init.d/cups 
> /etc/init.d/cups
> % ls /etc/rc*.d/*cups
> /etc/rc1.d/K01cups  /etc/rc2.d/S04cups  /etc/rc3.d/S04cups  /etc/rc4.d/S04cups  /etc/rc5.d/S04cups
> % sudo update-rc.d cups remove
> update-rc.d: using dependency based boot sequencing
> % ls /etc/rc*.d/*cups         
> zsh: no matches found: /etc/rc*.d/*cups
> % sudo update-rc.d cups defaults
> update-rc.d: using dependency based boot sequencing
> % ls /etc/rc*.d/*cups           
> /etc/rc1.d/K01cups  /etc/rc2.d/S04cups  /etc/rc3.d/S04cups  /etc/rc4.d/S04cups  /etc/rc5.d/S04cups
> 
> I'm fairly sure this didn't happen until recently.  But there were only
> two changes to update-rc.d in 2012, and both were trivial changes which
> didn't affect this.  This will need investigating in more detail.

I tried it on a system with sysv-rc 2.88dsf-22.1 which has *not* been
converted to dependency based boot yet. There it behaved as described in
the manual.

        $ ls -l /etc/init.d/pulseaudio 
        -rwxr-xr-x 1 root root 2249 Mai 18 20:54 /etc/init.d/pulseaudio
        $ sudo update-rc.d pulseaudio remove
        update-rc.d: /etc/init.d/pulseaudio exists during rc.d purge (use -f to force)

> > I guess the bug has been present for a longer time, so please update the
> > version information accordingly.
> > 
> > Two more or less related notes.
> > 
> > 1. The printing of `update-rc.d: using dependency based boot sequencing`
> > is unexpected.
> 
> It's always done this when using insserv AFAIK.  If you hadn't
> converted to using dependency based boot until 2.88dsf-28, this might
> be new though.

I used `update-rc.d` the first time, but the output looked strange to
me.

> I think we should remove it in wheezy+1 though, or even wheezy if it's
> not going to cause too much confusion--should people who have been
> converted to dependency based boot be reminded of the fact every time
> update-rc.d is run?

I guess the other maintainers and developers should answer that.

> > 2. To disable an init.d script, is it better to just remove the
> > executable flag of `/etc/init.d/name` with the latest changes in
> > 2.88dsf-28?
> 
> You can do that, certainly.  Or just use "update-rc.d service disable":
> 
> % sudo update-rc.d cups disable 
> update-rc.d: using dependency based boot sequencing
> insserv: warning: current start runlevel(s) (empty) of script `cups' overwrites defaults (2 3 4 5).
> insserv: warning: current stop runlevel(s) (1 2 3 4 5) of script `cups' overwrites defaults (1).
> % ls /etc/rc*.d/*cups          
> /etc/rc1.d/K01cups  /etc/rc2.d/K01cups  /etc/rc3.d/K01cups  /etc/rc4.d/K01cups  /etc/rc5.d/K01cups
> 
> % sudo update-rc.d cups enable 
> update-rc.d: using dependency based boot sequencing
> % ls /etc/rc*.d/*cups         
> /etc/rc1.d/K01cups  /etc/rc2.d/S04cups  /etc/rc3.d/S04cups  /etc/rc4.d/S04cups  /etc/rc5.d/S04cups
> 
> This converts the start links to stop links, and enable reverses this.

Thank you for the explanation. Although skimming through the manual
pages, I did not find how these links are used. Links starting with »S«
are executed with the `start` argument and links starting with »K« with
the `stop` argument?


Thanks,

Paul
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.alioth.debian.org/pipermail/pkg-sysvinit-devel/attachments/20120704/edb43a35/attachment.pgp>


More information about the Pkg-sysvinit-devel mailing list