[File-rc-users] Bug#688140: file-rc: File-rc doesn't restore rcX.d dirs at remove, breaks sysv-rc installation.

Roger Leigh rleigh at codelibre.net
Wed Mar 20 12:10:33 UTC 2013


On Wed, Mar 20, 2013 at 12:22:52PM +0100, Michael Stapelberg wrote:
> Hi Roger,
> 
> Roger Leigh <rleigh at codelibre.net> writes:
> > So maybe what's missing is a call to insserv to recreate the
> > default links, or to create the links and run insserv to
> > correctly reorder them in dependency order.  The old link
> > recreation behaviour used the pre-insserv static ordering IIRC,
> > and that's certainly wrong.
> I’m not too sure if I understood you right, and I certainly don’t get
> all the details of how this stuff works, but this is my proposed fix:
> 
> --- file-rc-0.8.14/debian/changelog	2012-08-19 20:56:20.000000000 +0200
> +++ file-rc-0.8.15/debian/changelog	2013-03-20 12:12:49.000000000 +0100
> @@ -1,3 +1,11 @@
> +file-rc (0.8.15) unstable; urgency=low
> +
> +  * Non-maintainer upload.
> +  * Call rcfile2link.sh followed by insserv to properly restore links when
> +    removing file-rc (Closes: #688140)
> +
> + -- Michael Stapelberg <stapelberg at debian.org>  Wed, 20 Mar 2013 12:12:48 +0100
> +
>  file-rc (0.8.14) unstable; urgency=low
>  
>    * Depend on insserv, this prevents upgrade problems with systems
> diff -Nru file-rc-0.8.14/debian/prerm file-rc-0.8.15/debian/prerm
> --- file-rc-0.8.14/debian/prerm	2012-07-30 07:49:08.000000000 +0200
> +++ file-rc-0.8.15/debian/prerm	2013-03-20 12:21:39.000000000 +0100
> @@ -19,6 +19,8 @@
>  
>  case "$1" in
>      remove)
> +        /usr/share/file-rc/rcfile2link.sh
> +        /sbin/insserv
>          ;;
>      upgrade|deconfigure)
>  	;;
> 
> I’ve tested installing file-rc in squeeze, then upgrading to wheezy,
> upgrading to file-rc 0.8.15, then installing sysv-rc, and the links come
> back correctly.
> 
> Roger, what do you think? Is this an acceptable fix?

I /think/ so, but IIRC there were some corner cases where this
previously caused problems.  Possibly with disabled services,
where the K links should exist but not S.  Maybe disable some
services, and then check that you can round trip from
sysv-rc to file-rc and back to sysv-rc maintaining the state.
And likewise for disabling/enabling a service in file-rc and
preserving this when moving to sysv-rc.

You might want to look at
/var/lib/dpkg/info/sysv-rc.postinst to see how it expects the
links to appear before running insserv (rcfile2link.sh could
be updated to match the behaviour if it hasn't been already).
This is basically
- no S links in rc0/rc6
- no K links in any runlevel containing an equivalent S link
or else insserv might complain.  This may be rectified after
running insserv, but is worth checking.  Maybe take a copy of
/etc at each stage then you can diff the changes.

Some state might be lost going back to sysv-rc since any
manual edits to the file-rc config not done via update-rc.d
will not be preserved since they aren't in the LSB script
header.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux    http://people.debian.org/~rleigh/
 `. `'   schroot and sbuild  http://alioth.debian.org/projects/buildd-tools
   `-    GPG Public Key      F33D 281D 470A B443 6756 147C 07B3 C8BC 4083 E800



More information about the File-rc-users mailing list