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

[PATCH] Fix lb_chroot_upstart to use correct path to initctl



Hello,

 Please accept this patch against live-build 2.x to fix lb_chroot_upstart. It currently looks for initctl in /usr/sbin/ which is incorrect - it lives in /sbin/. I've looked at the package file lists for the upstart package in the development version of Ubuntu (natty), Ubuntu 10.10, Ubuntu 10.04, Ubuntu 9.10, Ubuntu 8.04, Debian Stable (Squeeze), Debian Testing (Wheezy), and Debian Unstable (Sid) and initctl does not live in /usr/sbin/ in any of these releases. I've also asked the author of upstart Scott James Remnant if he was aware of initctl ever living in /usr/sbin/ and he said never.

Cheers,

--
Cody A.W. Somerville
Release Engineer
Foundations Team
Custom Engineering Solutions Group
Canonical OEM Services
Phone: +1 781 850 2087
Cell: +1 613 401 5141
Fax: +1 613 687 7368
Email: cody.somerville@canonical.com
=== modified file 'scripts/build/lb_chroot_upstart'
--- scripts/build/lb_chroot_upstart	2010-09-26 13:03:13 +0000
+++ scripts/build/lb_chroot_upstart	2011-02-25 20:21:42 +0000
@@ -14,7 +14,7 @@
 . "${LB_BASE:-/usr/share/live/build}"/scripts/build.sh
 
 # Setting static variables
-DESCRIPTION="$(Echo 'manage /usr/sbin/initctl')"
+DESCRIPTION="$(Echo 'manage /sbin/initctl')"
 HELP=""
 USAGE="${PROGRAM} {install|remove} [--force]"
 
@@ -29,7 +29,7 @@
 
 case "${1}" in
 	install)
-		Echo_message "Configuring file /usr/sbin/initctl"
+		Echo_message "Configuring file /sbin/initctl"
 
 		# Checking stage file
 		Check_stagefile .stage/chroot_upstart
@@ -40,27 +40,27 @@
 		# Creating lock file
 		Create_lockfile .lock
 
-		if [ -f chroot/usr/sbin/initctl ]
+		if [ -f chroot/sbin/initctl ]
 		then
 			# Save initctl file
-			mv chroot/usr/sbin/initctl chroot/usr/sbin/initctl.orig
+			mv chroot/sbin/initctl chroot/sbin/initctl.orig
 		fi
 
 		# Create initctl file
-cat > chroot/usr/sbin/initctl << EOF
+cat > chroot/sbin/initctl << EOF
 #!/bin/sh
 echo "All runlevel operations denied by policy" >&2
 exit 101
 EOF
 
-		chmod 0755 chroot/usr/sbin/initctl
+		chmod 0755 chroot/sbin/initctl
 
 		# Creating stage file
 		Create_stagefile .stage/chroot_upstart
 		;;
 
 	remove)
-		Echo_message "Deconfiguring file /usr/sbin/initctl"
+		Echo_message "Deconfiguring file /sbin/initctl"
 
 		# Checking lock file
 		Check_lockfile .lock
@@ -68,13 +68,13 @@
 		# Creating lock file
 		Create_lockfile .lock
 
-		if [ -f chroot/usr/sbin/initctl.orig ]
+		if [ -f chroot/sbin/initctl.orig ]
 		then
 			# Restore initctl file
-			mv chroot/usr/sbin/initctl.orig chroot/usr/sbin/initctl
+			mv chroot/sbin/initctl.orig chroot/sbin/initctl
 		else
 			# Remove initctl file
-			rm -f chroot/usr/sbin/initctl
+			rm -f chroot/sbin/initctl
 		fi
 
 		# Removing stage file


Reply to: