On Sun, Jan 08, 2012 at 11:22:41AM +0000, Roger Leigh wrote:
> On Fri, Jan 06, 2012 at 03:25:53PM +0100, Robert Millan wrote:
> > I didn't notice this was actually a Release Goal [1].  Tagging appropiately.
> > 
> > I should note that the patch I sent has an unwanted side-effect:
> > unability to send messages to init until after first reboot, which
> > means first reboot can't be done cleanly.
> > 
> > Maybe clients can be modified to attempt old path first then try with
> > /run/initctl (or vice-versa), or update scripts could play some kind
> > of symlink trick.  I haven't had time to resolve this however.
> 
> How about on upgrade we symlink /run/initctl → /dev/initctl if
> /run/initctl does not exist?
> Programs can therefore be switched to using /run/initctl immediately.
> On reboot, we can then just create /run/initctl and everything
> should just work.
> 
> Does this sound OK, or have I missed something unobvious?

BTW, all of your upstream changes are already in sysvinit.git
(http://anonscm.debian.org/gitweb/?p=collab-maint/sysvinit;a=blob_plain;f=debian/patches/93_run_initctl.patch;hb=a0263c14e64f0bbab10f656284272a8c9066189b)

I would propose something like the following, based on your
patch, would complete the migration (attached).  Not yet tested.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please GPG sign your mail.
diff --git a/debian/patches/series b/debian/patches/series
index c8af391..7ac3e82 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -17,4 +17,5 @@
 79_noninteractive_ignore_sigint.patch
 91_sulogin_lockedpw.dpatch
 92_kfreebsd_ifdown.patch
+93_run_initctl.patch
 94_kfreebsd_xterm.patch
diff --git a/debian/postinst b/debian/postinst
index 10d77a2..d876704 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -16,18 +16,17 @@ esac
 
 umask 022
 
+INITCTL=/run/initctl
 case "$(uname -s)" in
   *FreeBSD)
-	INITCTL=/etc/.initctl
+	OLDINITCTL=/etc/.initctl
 	;;
   *)
-	INITCTL=/dev/initctl
+	OLDINITCTL=/dev/initctl
 	;;
 esac
 
-#
-# Check /dev/initctl
-#
+# Create /run/initctl
 if [ "$INITCTL" ] && [ ! -p "$INITCTL" ]
 then
 	echo "sysvinit: creating $INITCTL"
@@ -46,6 +45,12 @@ fi
 #
 init u ||:
 
+# Remove old pipe if present.  No longer in use after re-exec.
+if [ "$OLDINITCTL" ] && [ -p "$OLDINITCTL" ]
+then
+        rm -f "$OLDINITCTL"
+fi
+
 #DEBHELPER#
 
 exit 0
diff --git a/debian/src/initscripts/etc/init.d/mountall.sh b/debian/src/initscripts/etc/init.d/mountall.sh
index 1daf994..033f9b8 100755
--- a/debian/src/initscripts/etc/init.d/mountall.sh
+++ b/debian/src/initscripts/etc/init.d/mountall.sh
@@ -43,26 +43,6 @@ do_start() {
 	fi
 	post_mountall
 
-	case "$(uname -s)" in
-	  *FreeBSD)
-		INITCTL=/etc/.initctl
-		;;
-	  *)
-		INITCTL=/dev/initctl
-		;;
-	esac
-
-	#
-	# We might have mounted something over /dev, see if
-	# /dev/initctl is there.  Look for /usr/share/sysvinit/update-rc.d
-	# to verify that sysvinit (and not upstart) is installed).
-	#
-	if [ ! -p $INITCTL ] && [ -f /usr/share/sysvinit/update-rc.d ]; then
-		rm -f $INITCTL
-		mknod -m 600 $INITCTL p
-		kill -USR1 1
-	fi
-
 	# Execute swapon command again, in case we want to swap to
 	# a file on a now mounted filesystem.
 	swaponagain 'swapfile'

Reply via email to