[debhelper-devel] Bug#749400: dh_installinit: disable init scripts on removal of package

Alan Jenkins alan.christopher.jenkins at gmail.com
Fri Jun 9 16:24:38 UTC 2017


On Thu, 24 Dec 2015 00:34:22 -0300 Felipe Sateler <fsateler at debian.org> 
wrote:

 > > On Mon, 26 May 2014 18:23:20 -0007 Cameron Norman
 > > <camerontnorman at gmail.com> wrote:
 > > > Package: debhelper
 > > >
 > > > Greetings,
 > > >
 > > > It would be much cleaner to disable init scripts when the package is
 > > > uninstalled, so that a bunch of shell scripts that just run "[ -x
 > > > $DAEMON ] || exit 0" are not slowing down the boot.

 > > > I think it would just be overall cleaner to disable the init
 > > > configuration on removal of the package with a "update-rc.d disable
 > > > $daemon".
 > > >
 > > > Thank you,
 > > > --
 > > > Cameron Norman
 > >
 > > Hi,
 > >
 > > Unfortunately, our attempt to solve this bug as caused a severe
 > > regression (please see #806276) and had to be reverted.
 > >
 > > Apparently it is *not* safe to call "update-rc.d #SCRIPT# disable"
 > > unconditionally. It is not entirely clear to me why/when it would work
 > > / not work, so I will put this on hold until further notice.
 >
 > The problem seems to be that update-rc.d bails out when Default-Start
 > is empty. For example, the mdadm-waitidle init script has no
 > Default-Start (only Default-Stop). Update-rc.d has the following
 > check:
 >
 > ($start_lvls, $stop_lvls) = parse_def_start_stop($lsb_header);
 > @toggle_lvls = @$start_lvls;
 > if ($#toggle_lvls < 0) {
 > error("$name Default-Start contains no runlevels, aborting.");
 > }
 >
 > And indeed on mdadm-waitidle neither enable or disable work. It seems
 > to me this is just an oversight, and update-rc.d should consider both
 > start and stop runlevels. I'm now CCing the sysvinit maintainers and
 > Andreas Hendriksson (which expressed interest in update-rc.d earlier)

Thanks for the analysis on this bug!  I'd like to see it progress.

I want to avoid a boot-time warning, which is caused by how 
`dh_systemd_enable` handles package removal.  I can see a clear path, 
but only if we can get `dh_installinit` to disable init scripts on 
package removal.

Why don't we use `update-rc.d FOO remove` on package removal?  This 
would simply remove all the symlinks.  (The manpage says we also need to 
pass `-f` if the init script itself will still exist, but the manpage is 
wrong).

#808887 should not block this bug IMO.  Extending `update-rc.d` so it 
can disable mdadm-waitidle etc doesn't seem like a great idea to me.  I 
notice `chkconfig FOO off` (used in RPM scripts) has the same design 
limitation.

Regards
Alan




More information about the debhelper-devel mailing list