Debian Bug report logs - #539591
file-rc: Need to use dependency based boot sequencing from now on

version graph

Package: file-rc; Maintainer for file-rc is file-rc maintainers <file-rc-users@lists.alioth.debian.org>; Source for file-rc is src:file-rc.

Reported by: Petter Reinholdtsen <pere@hungry.com>

Date: Sun, 2 Aug 2009 09:18:02 UTC

Severity: wishlist

Tags: patch

Found in version file-rc/0.8.11

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Roland Rosenfeld <roland@debian.org>:
Bug#539591; Package file-rc. (Sun, 02 Aug 2009 09:18:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Petter Reinholdtsen <pere@hungry.com>:
New Bug report received and forwarded. Copy sent to Roland Rosenfeld <roland@debian.org>. (Sun, 02 Aug 2009 09:18:04 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Petter Reinholdtsen <pere@hungry.com>
To: submit@bugs.debian.org
Subject: file-rc: Need to use dependency based boot sequencing from now on
Date: Sun, 2 Aug 2009 11:15:33 +0200
Package: file-rc
Version: 0.8.11
Severity: important
User: initscripts-ng-devel@lists.alioth.debian.org
Usertags: runtime-problem

Hi.  For Debian Squeeze, update-rc.d will change behaviour to order
init.d scripts using dependencies.  This means file-rc need to change
to work like this too.  The change has already been done in sysv-rc.

Kel and me are working on fixing the migration problem that was
introduced when sysv-rc made dependency based boot sequencing
mandatory, to allow file-rc to be installed again.  For file-rc to
work properly, it also need to change to order scripts the same way
sysv-rc do.

Setting severity to important for now.  Perhaps critical is a better
severity for this issue?

Happy hacking,
-- 
Petter Reinholdtsen




Information forwarded to debian-bugs-dist@lists.debian.org, Roland Rosenfeld <roland@debian.org>:
Bug#539591; Package file-rc. (Sat, 08 Aug 2009 08:33:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to Petter Reinholdtsen <pere@hungry.com>:
Extra info received and forwarded to list. Copy sent to Roland Rosenfeld <roland@debian.org>. (Sat, 08 Aug 2009 08:33:07 GMT) Full text and rfc822 format available.

Message #10 received at 539591@bugs.debian.org (full text, mbox):

From: Petter Reinholdtsen <pere@hungry.com>
To: 539591@bugs.debian.org
Subject: Re: file-rc: Need to use dependency based boot sequencing from now on
Date: Sat, 8 Aug 2009 10:32:11 +0200
Thought it best to add a reference from this bug to BTS report
#539609, where the file-rc maintainer ask for someone to take over
maintainence of file-rc to get this issue fixed.

Happy hacking,
-- 
Petter Reinholdtsen




Information forwarded to debian-bugs-dist@lists.debian.org, Roland Rosenfeld <roland@debian.org>:
Bug#539591; Package file-rc. (Tue, 11 Aug 2009 08:06:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alexander Wirt <formorer@formorer.de>:
Extra info received and forwarded to list. Copy sent to Roland Rosenfeld <roland@debian.org>. (Tue, 11 Aug 2009 08:06:03 GMT) Full text and rfc822 format available.

Message #15 received at 539591@bugs.debian.org (full text, mbox):

From: Alexander Wirt <formorer@formorer.de>
To: 539591@bugs.debian.org
Cc: control@bugs.debian.org
Subject: file-rc: Need to use dependency based boot sequencing from now on
Date: Tue, 11 Aug 2009 10:03:17 +0200
severity 539591 wishlist
thanks

> Package: file-rc
> Version: 0.8.11
> Severity: important
> User: initscripts-ng-devel@lists.alioth.debian.org
> Usertags: runtime-problem
> 
> Hi.  For Debian Squeeze, update-rc.d will change behaviour to order
> init.d scripts using dependencies.  This means file-rc need to change
> to work like this too.  The change has already been done in sysv-rc.
> 
> Kel and me are working on fixing the migration problem that was
> introduced when sysv-rc made dependency based boot sequencing
> mandatory, to allow file-rc to be installed again.  For file-rc to
> work properly, it also need to change to order scripts the same way
> sysv-rc do.
> 
> Setting severity to important for now.  Perhaps critical is a better
> severity for this issue?
This is stupid. You broke it, please repair it. Until dependency based boot
sequencing is part of the policy don't try to force people into it. Please
fix your own stuff first. 

Alex





Severity set to 'wishlist' from 'important' Request was from Alexander Wirt <formorer@formorer.de> to control@bugs.debian.org. (Tue, 11 Aug 2009 08:06:04 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Roland Rosenfeld <roland@debian.org>:
Bug#539591; Package file-rc. (Sun, 07 Mar 2010 11:00:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Marc Haber <mh+debian-bugs@zugschlus.de>:
Extra info received and forwarded to list. Copy sent to Roland Rosenfeld <roland@debian.org>. (Sun, 07 Mar 2010 11:00:05 GMT) Full text and rfc822 format available.

Message #22 received at 539591@bugs.debian.org (full text, mbox):

From: Marc Haber <mh+debian-bugs@zugschlus.de>
To: mika@grml.org, Alexander Wirt <formorer@formorer.de>, 539591@bugs.debian.org, 539591-submitter@bugs.debian.org
Cc: Marc Haber <mh+debian-bugs@zugschlus.de>
Subject: Re: Bug#539591: file-rc: Need to use dependency based boot sequencing from now on
Date: Sun, 7 Mar 2010 11:56:56 +0100
Hi,

On Tue, Aug 11, 2009 at 10:03:17AM +0200, Alexander Wirt wrote:
> severity 539591 wishlist
> thanks

I fear that file-rc's incompatibility with Debian's current default
init scheme is starting to become release critical, regardless of
policy or not. See "die normative Kraft des Faktischen".

> This is stupid. You broke it, please repair it. Until dependency based boot
> sequencing is part of the policy don't try to force people into it. Please
> fix your own stuff first. 

It is clear that pere is not going to change his package to accomodate
file-rc in its current form, and his way of doing things is the
default. So, I guess that file-rc is either dead, or it will adapt.
Please take that decision, so that your users know what to do in time
for squeeze.

Greetings
Marc

-- 
-----------------------------------------------------------------------------
Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Mannheim, Germany  |  lose things."    Winona Ryder | Fon: *49 621 72739834
Nordisch by Nature |  How to make an American Quilt | Fax: *49 621 72739835




Message sent on to Petter Reinholdtsen <pere@hungry.com>:
Bug#539591. (Sun, 07 Mar 2010 11:00:13 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Roland Rosenfeld <roland@debian.org>:
Bug#539591; Package file-rc. (Sun, 07 Mar 2010 11:24:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Petter Reinholdtsen <pere@hungry.com>:
Extra info received and forwarded to list. Copy sent to Roland Rosenfeld <roland@debian.org>. (Sun, 07 Mar 2010 11:24:03 GMT) Full text and rfc822 format available.

Message #30 received at 539591@bugs.debian.org (full text, mbox):

From: Petter Reinholdtsen <pere@hungry.com>
To: Marc Haber <mh+debian-bugs@zugschlus.de>, 539591-quiet@bugs.debian.org
Cc: mika@grml.org, Alexander Wirt <formorer@formorer.de>, 539591@bugs.debian.org
Subject: Re: Bug#539591: file-rc: Need to use dependency based boot sequencing from now on
Date: Sun, 7 Mar 2010 12:22:32 +0100
[Marc Haber]
> It is clear that pere is not going to change his package to
> accomodate file-rc in its current form, and his way of doing things
> is the default. So, I guess that file-rc is either dead, or it will
> adapt.  Please take that decision, so that your users know what to
> do in time for squeeze.

Actually, I have changed sysv-rc to accomodate more for file-rc, and
those migrating from sysv-rc to file-rc will revert to the sequence
numbers provided when update-rc.d was called.  I do not plan to do
anything more in sysv-rc, as I believe this is enough to let file-rc
users keep the old behaviour.

What that is said, I still believe file-rc need to move to dependency
based boot sequencing, but leave it to the file-rc maintainers and
users to spend time on it.  I suspect the sequence numbers used when
calling update-rc.d will slowly decay as it isn't used by default in
Debian any more, and the package maintainers slowly discover that bugs
in the boot script ordering that are trivial to fix with dependency
based sequencing is very hard to fix using the old sequence number
based system.  But I believe this will happen independently from what
effort I put into the topic, so I do not see the point of spending any
time on it. :)

Happy hacking,
-- 
Petter Reinholdtsen




Information stored :
Bug#539591; Package file-rc. (Sun, 07 Mar 2010 11:24:09 GMT) Full text and rfc822 format available.

Acknowledgement sent to Petter Reinholdtsen <pere@hungry.com>:
Extra info received and filed, but not forwarded. (Sun, 07 Mar 2010 11:24:09 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Roland Rosenfeld <roland@debian.org>:
Bug#539591; Package file-rc. (Sun, 07 Mar 2010 11:54:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alexander Wirt <formorer@formorer.de>:
Extra info received and forwarded to list. Copy sent to Roland Rosenfeld <roland@debian.org>. (Sun, 07 Mar 2010 11:54:03 GMT) Full text and rfc822 format available.

Message #40 received at 539591@bugs.debian.org (full text, mbox):

From: Alexander Wirt <formorer@formorer.de>
To: Marc Haber <mh+debian-bugs@zugschlus.de>
Cc: mika@grml.org, 539591@bugs.debian.org, 539591-submitter@bugs.debian.org
Subject: Re: Bug#539591: file-rc: Need to use dependency based boot sequencing from now on
Date: Sun, 7 Mar 2010 12:50:35 +0100
Marc Haber schrieb am Sonntag, den 07. M�rz 2010:

Hi, 

> On Tue, Aug 11, 2009 at 10:03:17AM +0200, Alexander Wirt wrote:
> > severity 539591 wishlist
> > thanks
> 
> I fear that file-rc's incompatibility with Debian's current default
> init scheme is starting to become release critical, regardless of
> policy or not. See "die normative Kraft des Faktischen".
> 
> > This is stupid. You broke it, please repair it. Until dependency based boot
> > sequencing is part of the policy don't try to force people into it. Please
> > fix your own stuff first. 
> 
> It is clear that pere is not going to change his package to accomodate
> file-rc in its current form, and his way of doing things is the
> default. So, I guess that file-rc is either dead, or it will adapt.
> Please take that decision, so that your users know what to do in time
> for squeeze.
file-rc works fine in squeeze and since dependency based booting is not
mandatory (yet) there are no changes needed. 

I'm currently working with others on making dependency based booting
mandatory for squeeze+1 and on making this available for squeeze+1. 

For squeeze things will stay as they are. 

Alex





Message sent on to Petter Reinholdtsen <pere@hungry.com>:
Bug#539591. (Sun, 07 Mar 2010 11:54:05 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, file-rc maintainers <file-rc-users@lists.alioth.debian.org>:
Bug#539591; Package file-rc. (Sun, 23 May 2010 08:24:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Petter Reinholdtsen <pere@hungry.com>:
Extra info received and forwarded to list. Copy sent to file-rc maintainers <file-rc-users@lists.alioth.debian.org>. (Sun, 23 May 2010 08:24:03 GMT) Full text and rfc822 format available.

Message #48 received at 539591@bugs.debian.org (full text, mbox):

From: Petter Reinholdtsen <pere@hungry.com>
To: 539591@bugs.debian.org
Subject: Re: Bug#539591: file-rc: Need to use dependency based boot sequencing from now on
Date: Sun, 23 May 2010 10:22:17 +0200
Kel wrote a patch for insserv to allow it to be used to generate a
file-rc style runlevel.conf file.  It is provided in the source
package, see bug #573004 for the details, but will not be activated
until it is known to actually work for file-rc.

JFYI.

Happy hacking,
-- 
Petter Reinholdtsen




Information forwarded to debian-bugs-dist@lists.debian.org, file-rc maintainers <file-rc-users@lists.alioth.debian.org>:
Bug#539591; Package file-rc. (Fri, 29 Jun 2012 19:30:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Roger Leigh <rleigh@codelibre.net>:
Extra info received and forwarded to list. Copy sent to file-rc maintainers <file-rc-users@lists.alioth.debian.org>. (Fri, 29 Jun 2012 19:30:06 GMT) Full text and rfc822 format available.

Message #53 received at 539591@bugs.debian.org (full text, mbox):

From: Roger Leigh <rleigh@codelibre.net>
To: Alexander Wirt <formorer@debian.org>, 539591@bugs.debian.org
Cc: debian-devel@lists.debian.org, pkg-sysvinit-devel@lists.alioth.debian.org
Subject: Re: [Pkg-sysvinit-devel] Future of update-rc.d in wheezy+1
Date: Fri, 29 Jun 2012 20:27:22 +0100
tags 539591 + patch
thanks

On Thu, Jun 28, 2012 at 02:40:18PM +0100, Roger Leigh wrote:
> On Thu, Jun 28, 2012 at 08:02:33AM +0200, Alexander Wirt wrote:
> > On Wed, 27 Jun 2012, Roger Leigh wrote:
> > 
> > > On Wed, Jun 27, 2012 at 04:39:38PM +0200, Bernd Zeimetz wrote:
> > > > On 06/27/2012 03:46 PM, Alexander Wirt wrote:
> > > > > On Wed, 27 Jun 2012, Paul Wise wrote:
> > > > > 
> > > > >> On Wed, Jun 27, 2012 at 6:27 PM, Petter Reinholdtsen wrote:
> > > > >>
> > > > >>> Yes.  See <URL: http://bugs.debian.org/539591 >,
> > > > >>> <URL: http://bugs.debian.org/573004 > and the source of insserv, where
> > > > >>> a patch to do this was created and included by Kel.  The patch has
> > > > >>> been available for more than two years.
> > > > >>
> > > > >> Hmm, no upload in those two years either. Is file-rc still maintained at all?
> > > > > It is. But more or less in "no-new-features" mode.
> > > > > 
> > > > > Implementing the insserv stuff is wishlist for me. Even when I now get
> > > > > forced into it.
> > > 
> > > I don't think there's any question of "forcing", but encouraging
> > > file-rc to retain compatibility with the init scripts being used by the
> > > distribution.  It looks like the patches are there, they just need
> > > testing.  If file-rc could have this in place for wheezy, that would
> > > be highly desirable, so that we can work on deprecating runlevel
> > > sequence numbers in wheezy+1.
> > Nope, there is an experimental patch for insserv to print out sequence
> > numbers, to get this working I first have to build my own insserv. And the
> > whole file-rc part is - beside of some ideas in my mind - missing.
> 
> So the insserv patch is already present, it just needs enabling.  So
> 10 mins tops to download and rebuild.  I never saw a followup in the
> bug above--does the output format suit your needs?  If it does, please
> say so.  It could potentially be enabled and uploaded today or tomorrow.

The patch works just fine.  I retested it this evening.  Short example:

% insserv -s | egrep '(postgresql|cron|procps|sudo)$'
K:02:0 1 6:postgresql
K:01:0 1 6:anacron
S:02:2 3 4 5:postgresql
S:02:2 3 4 5:anacron
S:02:2 3 4 5:cron
S:01:2 3 4 5:sudo
S:13:S:procps

> One you have the dependency info, can't you just query that in your
> update-rc.d implementation to override the defaults provided to
> update-rd.d?  Does it require anything more complex than that?

The following patch implements this behaviour.  While the insserv
parsing logic has been tested, it's not been tested for upgrades
or whether the whole script works correctly.

- it needs a Depends on insserv (>= $version_with_-s)
  ==> this needs your feedback so it can be uploaded.
- the preinst could be simplified to just use
    update-rc.d "$script" -f defaults
  if this is sufficient to update the sequence numbers in the
  configuration.  This probably needs running in the postinst TBH.
- this just replaces the defaults and user-provided start and stop
  arguments with those provided by insserv.  Other than that, there
  are no changes to anything else.
- You might need to retain support for the old-style logic so that
  if other scripts call update-rc.d in the gap between unpacking and
  running the postinst, it won't fail.  Just back out the deletions
  and run those blocks only if insserv didn't run or didn't find any
  matches, which are a trivial addition to the script.

While this patch is just a proof a concept, this should be pretty much
all you need.  It just needs checking and testing by someone with
file-rc expertise.  If this could be done in the very near future,
then that would be great.

Please do provide some feedback on whether "insserv -s" is sufficient
for your needs.


Thanks,
Roger


diff -urN file-rc-0.8.12.original/debian/changelog file-rc-0.8.13/debian/changelog
--- file-rc-0.8.12.original/debian/changelog	2010-04-07 20:30:54.000000000 +0100
+++ file-rc-0.8.13/debian/changelog	2012-06-29 20:00:01.917474582 +0100
@@ -1,3 +1,10 @@
+file-rc (0.8.13) UNRELEASED; urgency=low
+
+  * Use insserv for runlevel defaults rather than the arguments
+    provided to update-rc.d.
+
+ -- Roger Leigh <rleigh@debian.org>  Fri, 29 Jun 2012 19:59:06 +0100
+
 file-rc (0.8.12) unstable; urgency=low
 
   * New maintainer (Closes: #539609)
diff -urN file-rc-0.8.12.original/debian/preinst file-rc-0.8.13/debian/preinst
--- file-rc-0.8.12.original/debian/preinst	2010-04-07 20:30:54.000000000 +0100
+++ file-rc-0.8.13/debian/preinst	2012-06-29 20:06:18.739474331 +0100
@@ -14,6 +14,8 @@
 # for details, see http://www.debian.org/doc/debian-policy/ or
 # the debian-policy package
 
+# Make sure insserv is in path
+PATH=/sbin:$PATH
 
 case "$1" in
     install)
@@ -64,6 +66,19 @@
 	    dpkg-divert --package file-rc --remove \
 		--divert /etc/init.d/rcS.links /etc/init.d/rcS
 	fi
+
+	if [ "$2" != "" ] && dpkg --compare-versions $2 lt 0.8.13
+	then
+	    for script in /etc/init.d/*
+	    do
+		if [ -x "$script" ]
+		then
+		    script=$(basename "$script")
+		    update-rc.d "$script" -f remove
+		    update-rc.d "$script" defaults
+		fi
+	    done
+	fi
     ;;
 
     abort-upgrade)
diff -urN file-rc-0.8.12.original/update-rc.d file-rc-0.8.13/update-rc.d
--- file-rc-0.8.12.original/update-rc.d	2010-04-07 20:30:54.000000000 +0100
+++ file-rc-0.8.13/update-rc.d	2012-06-29 20:12:33.526270570 +0100
@@ -227,34 +227,27 @@
     return 1
 }
 
-
-START_SORT_NO=""
-STOP_SORT_NO=""
-STARTLEVELS=""
-STOPLEVELS=""
+OLDIFS="$IFS"
+IFS=:
+insserv -s | while read IN_ACTION IN_SEQUENCE IN_LEVELS IN_BASENAME
+do
+    if [ "$IN_BASENAME" = "$basename" ]; then
+	if [ "$IN_ACTION" = "S" ]; then
+	    START_SORT_NO="$IN_SEQUENCE"
+	    STARTLEVELS="$IN_LEVELS"
+	elif [ "$IN_ACTION" = "K" ]; then
+	    STOP_SORT_NO="$IN_SEQUENCE"
+	    STOPLEVELS="$IN_LEVELS"
+	fi
+    fi
+done
+IFS="$OLDIFS"
 
 STARTLIST=
 STOPLIST=
 action="$1"
 case "$action" in
     defaults)
-	STARTLEVELS="2 3 4 5"
-	STOPLEVELS="0 1 6"
-	case "$#" in
-	    "1")
-		START_SORT_NO="20"
-		STOP_SORT_NO="20"
-		;;
-	    "2")
-		START_SORT_NO="$2"
-		STOP_SORT_NO="$2"
-		;;
-	    "3")
-		START_SORT_NO="$2"
-		STOP_SORT_NO="$3"
-		;;
-	esac
-
 	if ! is_valid_sequence $START_SORT_NO || ! is_valid_sequence $STOP_SORT_NO
 	then
 	    echo "Invalid sequence $START_SORT_NO or $STOP_SORT_NO."
@@ -273,55 +266,6 @@
 	STOP_SORT_NO="*"
 	;;
     start|stop)
-	# Loop over the remaining arguments
-	while [ $# -gt 0 ]
-	do
- 	    if [ $# -gt 2 ]
- 	    then
- 		type="$1"; shift
- 		seq="$1"; shift
- 		levels=
-		if [ "$type" != "start" -a "$type" != "stop" ]
-		then
-		    echo "Invalid type $type."
-		    exit 1
-		fi
- 		if ! is_valid_sequence $seq
- 		then
- 		    echo "Invalid sequence $seq."
- 		    exit 1
- 		fi
- 		while [ $# -gt 0 -a "$1" != "." ]
- 		do
-		    if ! is_valid_runlevel $1
-		    then
-			echo "Invalid runlevel $1."
-			exit 1
-		    fi
- 		    levels="$levels$1 "; shift
- 		done
- 		if [ $# -gt 0 -a "$1" = "." ]
- 		then
- 		    shift
- 		fi
-		case "$type" in
-		"start")
-		    for lev in $levels; do
-			STARTLIST="$STARTLIST$lev:$seq "
-		    done
-		    ;;
-		"stop")
-		    for lev in $levels; do
-			STOPLIST="$STOPLIST$lev:$seq "
-		    done
-		    ;;
-		esac
- 	    else
- 		echo "Too few arguments."
- 		print_usage
- 		exit 1
- 	    fi
-	done
 	action=add
 	;;
     *)
@@ -355,7 +299,7 @@
   # lock the configuration file
 echo "$$" > "$LOCKFILE"
 
-if [ $opt_force -eq 0 -a "$action" != "remove" ] && cmd_already_there 
+if [ $opt_force -eq 0 -a "$action" != "remove" ] && cmd_already_there
 then
     echo "$basename already in $CFGFILE: No change."
     remove_lock


-- 
  .''`.  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




Added tag(s) patch. Request was from Roger Leigh <rleigh@codelibre.net> to control@bugs.debian.org. (Fri, 29 Jun 2012 19:30:15 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, file-rc maintainers <file-rc-users@lists.alioth.debian.org>:
Bug#539591; Package file-rc. (Fri, 29 Jun 2012 21:54:30 GMT) Full text and rfc822 format available.

Acknowledgement sent to Roger Leigh <rleigh@codelibre.net>:
Extra info received and forwarded to list. Copy sent to file-rc maintainers <file-rc-users@lists.alioth.debian.org>. (Fri, 29 Jun 2012 21:54:39 GMT) Full text and rfc822 format available.

Message #60 received at 539591@bugs.debian.org (full text, mbox):

From: Roger Leigh <rleigh@codelibre.net>
To: Alexander Wirt <formorer@debian.org>, 539591@bugs.debian.org
Cc: pkg-sysvinit-devel@lists.alioth.debian.org
Subject: Re: [Pkg-sysvinit-devel] Future of update-rc.d in wheezy+1
Date: Fri, 29 Jun 2012 22:53:04 +0100
On Fri, Jun 29, 2012 at 08:27:22PM +0100, Roger Leigh wrote:
> The following patch implements this behaviour.  While the insserv
> parsing logic has been tested, it's not been tested for upgrades
> or whether the whole script works correctly.
> 
> - it needs a Depends on insserv (>= $version_with_-s)
>   ==> this needs your feedback so it can be uploaded.
> - the preinst could be simplified to just use
>     update-rc.d "$script" -f defaults
>   if this is sufficient to update the sequence numbers in the
>   configuration.  This probably needs running in the postinst TBH.
> - this just replaces the defaults and user-provided start and stop
>   arguments with those provided by insserv.  Other than that, there
>   are no changes to anything else.
> - You might need to retain support for the old-style logic so that
>   if other scripts call update-rc.d in the gap between unpacking and
>   running the postinst, it won't fail.  Just back out the deletions
>   and run those blocks only if insserv didn't run or didn't find any
>   matches, which are a trivial addition to the script.
> 
> While this patch is just a proof a concept, this should be pretty much
> all you need.  It just needs checking and testing by someone with
> file-rc expertise.  If this could be done in the very near future,
> then that would be great.

I've attached an updated patch.  This patch

- Retains the old pre-insserv logic, and falls back to it if insserv
  is not available, or if insserv fails to find the script.  This is
  to aid the transition (between the new file-rc being configured and
  the postinst being run to migrate all the scripts), and should be
  removed in wheezy+1.
- Adds extra safeguards around the insserv logic, so it's only run
  if insserv is available.
- Moves the migration from the preinst to the postinst, since insserv
  is only available in the postinst.
- Still requires a package dependency on the fixed version of insserv.

Hope this is OK.  Still needs testing, BTW.  I'll take a look at that
tomorrow, time permitting.


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




Information forwarded to debian-bugs-dist@lists.debian.org, file-rc maintainers <file-rc-users@lists.alioth.debian.org>:
Bug#539591; Package file-rc. (Sun, 01 Jul 2012 23:21:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Roger Leigh <rleigh@codelibre.net>:
Extra info received and forwarded to list. Copy sent to file-rc maintainers <file-rc-users@lists.alioth.debian.org>. (Sun, 01 Jul 2012 23:21:03 GMT) Full text and rfc822 format available.

Message #65 received at 539591@bugs.debian.org (full text, mbox):

From: Roger Leigh <rleigh@codelibre.net>
To: Alexander Wirt <formorer@debian.org>, 539591@bugs.debian.org
Cc: pkg-sysvinit-devel@lists.alioth.debian.org
Subject: Re: [Pkg-sysvinit-devel] Future of update-rc.d in wheezy+1
Date: Mon, 2 Jul 2012 00:16:31 +0100
[Message part 1 (text/plain, inline)]
On Fri, Jun 29, 2012 at 10:53:03PM +0100, Roger Leigh wrote:
> On Fri, Jun 29, 2012 at 08:27:22PM +0100, Roger Leigh wrote:
> > The following patch implements this behaviour.  While the insserv
> > parsing logic has been tested, it's not been tested for upgrades
> > or whether the whole script works correctly.
> > 
> > - it needs a Depends on insserv (>= $version_with_-s)
> >   ==> this needs your feedback so it can be uploaded.
> > - the preinst could be simplified to just use
> >     update-rc.d "$script" -f defaults
> >   if this is sufficient to update the sequence numbers in the
> >   configuration.  This probably needs running in the postinst TBH.
> > - this just replaces the defaults and user-provided start and stop
> >   arguments with those provided by insserv.  Other than that, there
> >   are no changes to anything else.
> > - You might need to retain support for the old-style logic so that
> >   if other scripts call update-rc.d in the gap between unpacking and
> >   running the postinst, it won't fail.  Just back out the deletions
> >   and run those blocks only if insserv didn't run or didn't find any
> >   matches, which are a trivial addition to the script.
> > 
> > While this patch is just a proof a concept, this should be pretty much
> > all you need.  It just needs checking and testing by someone with
> > file-rc expertise.  If this could be done in the very near future,
> > then that would be great.
> 
> I've attached an updated patch.

Another patch attached.  This one is somewhat more comprehensive.

- insserv support is "optional".  If insserv is not present, it will
  fall back to using static sequence numbers.  This will provide
  backward compatibility for squeeze upgrades.  For new installations
  from wheezy however, it will generate runlevel.conf using insserv.
  For wheezy+1, you'll likely be required to migrate existing users
  to using insserv, but for now it's optional.
- the output functions have been refactored to include start and
  stop entries on separate lines, because this is the common case
  (due to the sequence numbers for start and stop making no sense to
  be the same, unless it's pure coincidence).
- long obsolete code removed from maintainer scripts.

I've documented most of the user-visible change in NEWS.Debian and
the changelog.

The most important change is this: runlevel.conf is no longer user-
editable, except for adding and removing lines.  When using insserv,
the sequence numbers mean nothing, because they are dynamically
generated from the dependency information.  When you run update-rc.d,
the numbers could potentially change if a script is added or removed
from the middle of the sequence, causing all following scripts to be
renumbered.  This means that only two operations are possible:
1. remove a script.  This is equivalent to "update-rc.d remove"
2. add a script.  This is equivalent to
   "update-rc.d defaults|start|stop" (which are all equivalent from
   the insserv POV--they all just add/update the entries for the
   script according to the LSB dependencies)
So if you want to reorder the scripts, you just edit the LSB header
in the init script, and then run "update-rc.d foo defaults" to
effect the change.  This is a change from the historical behaviour
of file-rc, but it's the logical consequence of having dependency-
based boot: you edit the dependencies, not the script numbers.

Hope this all looks reasonable.  I've tested all the insserv
codepaths, but not the non-insserv case yet.  Testing
file-rc -> sysv-rc migration also needs doing (the change to
not restore the rcS links probably needs reverting).  Anyway,
I hope this is useful as a basis for implementing insserv
support in file-rc; hopefully I've done the bulk of the work and
it just remains to test and tweak, or back out any changes you're
unhappy with.  I'd appreciate any feedback; I can make any further
changes you need if you let me know what you want.


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
[filerc-insserv.patch (text/x-diff, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, file-rc maintainers <file-rc-users@lists.alioth.debian.org>:
Bug#539591; Package file-rc. (Sun, 22 Jul 2012 11:30:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alexander Wirt <formorer@debian.org>:
Extra info received and forwarded to list. Copy sent to file-rc maintainers <file-rc-users@lists.alioth.debian.org>. (Sun, 22 Jul 2012 11:30:06 GMT) Full text and rfc822 format available.

Message #70 received at 539591@bugs.debian.org (full text, mbox):

From: Alexander Wirt <formorer@debian.org>
To: Roger Leigh <rleigh@codelibre.net>
Cc: 539591@bugs.debian.org, pkg-sysvinit-devel@lists.alioth.debian.org
Subject: Re: [Pkg-sysvinit-devel] Future of update-rc.d in wheezy+1
Date: Sun, 22 Jul 2012 13:14:56 +0200
On Sun, 22 Jul 2012, Roger Leigh wrote:

> On Mon, Jul 02, 2012 at 12:16:31AM +0100, Roger Leigh wrote:
> > On Fri, Jun 29, 2012 at 10:53:03PM +0100, Roger Leigh wrote:
> > > On Fri, Jun 29, 2012 at 08:27:22PM +0100, Roger Leigh wrote:
> > > > The following patch implements this behaviour.  While the insserv
> > > > parsing logic has been tested, it's not been tested for upgrades
> > > > or whether the whole script works correctly.
> > > > 
> > > > - it needs a Depends on insserv (>= $version_with_-s)
> > > >   ==> this needs your feedback so it can be uploaded.
> > > > - the preinst could be simplified to just use
> > > >     update-rc.d "$script" -f defaults
> > > >   if this is sufficient to update the sequence numbers in the
> > > >   configuration.  This probably needs running in the postinst TBH.
> > > > - this just replaces the defaults and user-provided start and stop
> > > >   arguments with those provided by insserv.  Other than that, there
> > > >   are no changes to anything else.
> > > > - You might need to retain support for the old-style logic so that
> > > >   if other scripts call update-rc.d in the gap between unpacking and
> > > >   running the postinst, it won't fail.  Just back out the deletions
> > > >   and run those blocks only if insserv didn't run or didn't find any
> > > >   matches, which are a trivial addition to the script.
> > > > 
> > > > While this patch is just a proof a concept, this should be pretty much
> > > > all you need.  It just needs checking and testing by someone with
> > > > file-rc expertise.  If this could be done in the very near future,
> > > > then that would be great.
> > > 
> > > I've attached an updated patch.
> > 
> > Another patch attached.  This one is somewhat more comprehensive.
> > 
> > - insserv support is "optional".  If insserv is not present, it will
> >   fall back to using static sequence numbers.  This will provide
> >   backward compatibility for squeeze upgrades.  For new installations
> >   from wheezy however, it will generate runlevel.conf using insserv.
> >   For wheezy+1, you'll likely be required to migrate existing users
> >   to using insserv, but for now it's optional.
> > - the output functions have been refactored to include start and
> >   stop entries on separate lines, because this is the common case
> >   (due to the sequence numbers for start and stop making no sense to
> >   be the same, unless it's pure coincidence).
> > - long obsolete code removed from maintainer scripts.
> > 
> > I've documented most of the user-visible change in NEWS.Debian and
> > the changelog.
> > 
> > The most important change is this: runlevel.conf is no longer user-
> > editable, except for adding and removing lines.  When using insserv,
> > the sequence numbers mean nothing, because they are dynamically
> > generated from the dependency information.  When you run update-rc.d,
> > the numbers could potentially change if a script is added or removed
> > from the middle of the sequence, causing all following scripts to be
> > renumbered.  This means that only two operations are possible:
> > 1. remove a script.  This is equivalent to "update-rc.d remove"
> > 2. add a script.  This is equivalent to
> >    "update-rc.d defaults|start|stop" (which are all equivalent from
> >    the insserv POV--they all just add/update the entries for the
> >    script according to the LSB dependencies)
> > So if you want to reorder the scripts, you just edit the LSB header
> > in the init script, and then run "update-rc.d foo defaults" to
> > effect the change.  This is a change from the historical behaviour
> > of file-rc, but it's the logical consequence of having dependency-
> > based boot: you edit the dependencies, not the script numbers.
> > 
> > Hope this all looks reasonable.  I've tested all the insserv
> > codepaths, but not the non-insserv case yet.  Testing
> > file-rc -> sysv-rc migration also needs doing (the change to
> > not restore the rcS links probably needs reverting).  Anyway,
> > I hope this is useful as a basis for implementing insserv
> > support in file-rc; hopefully I've done the bulk of the work and
> > it just remains to test and tweak, or back out any changes you're
> > unhappy with.  I'd appreciate any feedback; I can make any further
> > changes you need if you let me know what you want.
> 
> Hi Alexander,
> 
> I've attached a (hopefully final) patch.  We now have updated
> insserv and sysvinit packages in unstable, so it's now safe to
> enable this.  It will work with or without insserv, so will
> work fine for upgrades and new installs.  It now transparantly
> works to install file-rc and sysv-rc and the configuration is
> migrated both ways depending on which you install.
Great. Thanks a lot for your work, it is really appreciated. Unfortunatly my
current workload leaves me with not much time left for debian, but I'll try
to upload the package til wednesday. I want to give it a few more tests
first.

Thanks again
Alex



Information forwarded to debian-bugs-dist@lists.debian.org, file-rc maintainers <file-rc-users@lists.alioth.debian.org>:
Bug#539591; Package file-rc. (Sun, 22 Jul 2012 13:03:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Roger Leigh <rleigh@codelibre.net>:
Extra info received and forwarded to list. Copy sent to file-rc maintainers <file-rc-users@lists.alioth.debian.org>. (Sun, 22 Jul 2012 13:03:03 GMT) Full text and rfc822 format available.

Message #75 received at 539591@bugs.debian.org (full text, mbox):

From: Roger Leigh <rleigh@codelibre.net>
To: Alexander Wirt <formorer@debian.org>
Cc: 539591@bugs.debian.org, pkg-sysvinit-devel@lists.alioth.debian.org
Subject: Re: [Pkg-sysvinit-devel] Future of update-rc.d in wheezy+1
Date: Sun, 22 Jul 2012 13:58:48 +0100
On Sun, Jul 22, 2012 at 01:14:56PM +0200, Alexander Wirt wrote:
> On Sun, 22 Jul 2012, Roger Leigh wrote:
> > 
> > I've attached a (hopefully final) patch.  We now have updated
> > insserv and sysvinit packages in unstable, so it's now safe to
> > enable this.  It will work with or without insserv, so will
> > work fine for upgrades and new installs.  It now transparantly
> > works to install file-rc and sysv-rc and the configuration is
> > migrated both ways depending on which you install.
> Great. Thanks a lot for your work, it is really appreciated. Unfortunatly my
> current workload leaves me with not much time left for debian, but I'll try
> to upload the package til wednesday. I want to give it a few more tests
> first.

No problem, it certainly could use some more testing.  I'm sure some
of the shell code could also be a bit more efficient--I've nested
some conditionals where you could probably just use &&.

I don't know if you saw my comment in #debian-devel, but you might
want to also add
  Breaks: insserv (<< 1.14.0-4)
to debian/control to ensure it only runs "insserv -s" on a version
providing this option.


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



Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sun Apr 20 01:42:12 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.