[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Switching the default startup method

(Put petter on CC, he's probably interested by the patch below)

On Mon, 24 Aug 2009, Alexander Wirt wrote:
> Luk Claes schrieb am Monday, den 24. August 2009:
> *snip*
> > Why would file-rc not work properly with dependency based booting?
> you know what file-rc is doing? You have a configfile where you list your
> services and the bootlevels. So we have a configfile here. I would have to
> reorder the whole file for dependency based booting, but how can I do this
> reliable? And even if I would be able to do this, this would mean to change a
> user configuration file which is against policy. 

How does file-rc handle the addition of a new init script? Does it modify
that configuration file?

Does it create that file where there is none? If yes, you could at that
point create it so that the initial list at least respects the
dependencies and leave it up to the admin for any future change.

> > You might want to look if insserv overrides can help.
> > 
> > What is broken with the usage of update-rc.d or the debconf switch?
> a) in my eyes low is the wrong priority as it changes vital system setting
> without further notice. Also a NEWS item would be useful. Another problem is
> that the changes are not revertible. 

On the other hand, low prio is the right thing to do if the upgrade just works
for 99% of the users. Ok for a NEWS item, feel free to file a bug for
this if you find it important.

If the non-revertible aspect is problematic for you, maybe you can try to
provide a patch to enhance/fix insserv's removal code?

> Removing sysv-rc ...
> Processing triggers for man-db ...
> Errors were encountered while processing:
>  insserv
> E: Sub-process /usr/bin/dpkg returned an error code (1
> - ok there we are... 
> dpkg-reconfigure insserv
> info: Disabling dependency based boot system
> mv: cannot stat `/usr/sbin/update-rc.d.distrib': No such file or directory

/usr/sbin/update-rc.d.distrib is the (diverted script) provided by sysv-rc and
since you removed it just above, that file doesn't exist anymore. Not
difficult to understand... and given that sysvinit (essential) pre-depends on
sysv-rc|file-rc, it seems natural for any code to assume this file
should be here.

Patching check_divert() in /usr/sbin/update-bootsystem-insserv doesn't
seem complicated...

--- /usr/sbin/update-bootsystem-insserv 2009-07-26 21:17:24.000000000 +0200
+++ /tmp/update-bootsystem-insserv      2009-08-26 09:33:43.000000000 +0200
@@ -76,7 +76,9 @@
         if [ -n "$div" ] && [ -z "${div%%*by $package}" ]; then
-           mv $distrib $2
+            if [ -e $distrib ]; then
+                mv $distrib $2
+            fi
            dpkg-divert --remove $2

Or maybe better, let dpkg-divert do the right thing:
--- /usr/sbin/update-bootsystem-insserv 2009-07-26 21:17:24.000000000 +0200
+++ /tmp/update-bootsystem-insserv      2009-08-26 09:36:59.000000000 +0200
@@ -76,8 +76,7 @@
         if [ -n "$div" ] && [ -z "${div%%*by $package}" ]; then
-           mv $distrib $2
-           dpkg-divert --remove $2
+           dpkg-divert --rename --remove $2
     status) # Return true if the divert is in effect

Both of these took me 5 minutes (they are untested though).

> This is the point where I say its broken. I would have to reinstall sysv-rc. Do a 
> dpkg-reconfigure insserv and after that try the install of file-rc again. Hey this really 
> can't be the way. 

I think we all agree on that... but complaining is not the way to gets things
going forward.

Raphaël Hertzog

Reply to: