[Branch,~linaro-image-tools/linaro-image-tools/trunk] Rev 502: Replace and then restore start-stop-daemon and initctl (LP: #98604):

Message ID 20120323062910.18042.5920.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Fathi Boudra March 23, 2012, 6:29 a.m.
Merge authors:
  Fathi Boudra (fboudra)
Related merge proposals:
  https://code.launchpad.net/~fboudra/linaro-image-tools/bug-912782-v2/+merge/98914
  proposed by: Fathi Boudra (fboudra)
  review: Approve - Loïc Minier (lool)
------------------------------------------------------------
revno: 502 [merge]
committer: Fathi Boudra <fathi.boudra@linaro.org>
branch nick: linaro-image-tools
timestamp: Fri 2012-03-23 08:27:06 +0200
message:
  Replace and then restore start-stop-daemon and initctl (LP: #98604):
  Upstart jobs and some init script don't honor policy-rc.d.
modified:
  linaro-hwpack-install


--
lp:linaro-image-tools
https://code.launchpad.net/~linaro-image-tools/linaro-image-tools/trunk

You are subscribed to branch lp:linaro-image-tools.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-image-tools/linaro-image-tools/trunk/+edit-subscription

Patch

=== modified file 'linaro-hwpack-install'
--- linaro-hwpack-install	2012-03-21 10:32:24 +0000
+++ linaro-hwpack-install	2012-03-23 06:13:05 +0000
@@ -90,6 +90,10 @@ 
   echo -n "Cleaning up ..."
   rm -rf $TEMP_DIR
   rm -f /usr/sbin/policy-rc.d
+  mv -f /sbin/start-stop-daemon.REAL /sbin/start-stop-daemon
+  if [ -x /sbin/initctl.REAL ]; then
+    mv -f /sbin/initctl.REAL /sbin/initctl
+  fi
   $sudo apt-get update -qq
   echo "Done"
 }
@@ -153,6 +157,24 @@ 
 echo "exit 101" > /usr/sbin/policy-rc.d
 chmod a+x /usr/sbin/policy-rc.d
 
+mv -f /sbin/start-stop-daemon /sbin/start-stop-daemon.REAL
+cat > /sbin/start-stop-daemon << EOF
+#!/bin/sh
+
+echo "Warning: Fake start-stop-daemon called, doing nothing"
+EOF
+chmod 755 /sbin/start-stop-daemon
+
+if [ -x /sbin/initctl ]; then
+  mv -f /sbin/initctl /sbin/initctl.REAL
+  cat > /sbin/initctl << EOF
+#!/bin/sh
+
+echo "Warning: Fake initctl called, doing nothing"
+EOF
+  chmod 755 /sbin/initctl
+fi
+
 # Add one extra apt source for the packages included in the hwpack and make
 # sure it's the first on the list of sources so that it gets precedence over
 # the others.