Subject: Bug#3215: `update-rc.d remove' doesn't remove /etc/init.d script

From: Rob Leslie <[email-masked]>
Date: Tue, 04 Jun 1996 20:14:26 -0400

Package: dpkg
Version: 1.2.3elf

According to the update-rc.d(8) man page:

  REMOVING SCRIPTS
         When invoked with the remove option,  update-rc.d  removes
         the  script and links to the script for the package <base-
         name>.   It  first  finds  and  removes  the   script   in
         /etc/init.d/  and  then removes all links to the script in
         /etc/rc[0123456].d/.

But:

  deimos:proj/debian/sendmail:[11]# update-rc.d sendmail remove
  update-rc.d: error: /etc/init.d/sendmail exists during rc.d purge.
  zsh: 1034 exit 1     update-rc.d sendmail remove

I wanted to use `update-rc.d sendmail remove' from sendmail's preinst, since
calling `update-rc.d sendmail defaults' won't renumber the links if they are
already present in the /etc/rc?.d directories. Do I need to remove the script
from /etc/init.d first myself, or shouldn't update-rc.d handle it?

--
Robert Leslie
[email-masked]

---

From: Ian Jackson <[email-masked]>
Date: Thu, 6 Jun 96 02:17 BST

Rob Leslie writes ("Bug#3215: `update-rc.d remove' doesn't remove /etc/init.d script"):
...
> >from  /etc/init.d first myself, or shouldn't update-rc.d handle it?

This is a documentation bug.  update-rc.d requires you to remove the
script before calling it.  In the usual case (update-rc.d remove
called from postinst purge) dpkg will have removed the script already
because it's a conffile.

If you want to renumber links you shouldn't purge and reinstall the
links, you should renumber them.  This is so that you won't change
things if the sysadmin has (for example) changed which runlevels have
sendmail running.

I've edited the manpage to fix this; the change will be in 1.2.4.  I
may revise the manpage completely - it looks pretty ropey at the
moment.

I'll close the bug report.

Ian.