From b9348447b9ed82b738856b7c105857dde1026fca Mon Sep 17 00:00:00 2001 From: Russell Sim Date: Sun, 17 Nov 2013 14:42:17 +1100 Subject: [PATCH] Don't block the upstart daemon if it doesn't exist Check if Upstart exists before blocking the daemon. Not all dpkg based OS's have Upstart installed so this should help increase compatibility. Closes-Bug: #1251949 Change-Id: I2dcb1ff3641778b5653ca5762a728398adb57da1 --- elements/dpkg/cleanup.d/40-unblock-daemons | 7 ++++--- elements/dpkg/root.d/99-block-daemons | 9 ++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/elements/dpkg/cleanup.d/40-unblock-daemons b/elements/dpkg/cleanup.d/40-unblock-daemons index a3095a17e..b30f4619f 100755 --- a/elements/dpkg/cleanup.d/40-unblock-daemons +++ b/elements/dpkg/cleanup.d/40-unblock-daemons @@ -5,7 +5,8 @@ set -e [ -n "$TARGET_ROOT" ] sudo mv $TARGET_ROOT/sbin/start-stop-daemon.REAL $TARGET_ROOT/sbin/start-stop-daemon -sudo mv $TARGET_ROOT/sbin/initctl.REAL $TARGET_ROOT/sbin/initctl +if [ -f $TARGET_ROOT/sbin/initctl.REAL ] +then + sudo mv $TARGET_ROOT/sbin/initctl.REAL $TARGET_ROOT/sbin/initctl +fi sudo mv $TARGET_ROOT/usr/sbin/invoke-rc.d.REAL $TARGET_ROOT/usr/sbin/invoke-rc.d - - diff --git a/elements/dpkg/root.d/99-block-daemons b/elements/dpkg/root.d/99-block-daemons index feb5a4a34..5594651ca 100755 --- a/elements/dpkg/root.d/99-block-daemons +++ b/elements/dpkg/root.d/99-block-daemons @@ -13,13 +13,16 @@ echo "Warning: Fake start-stop-daemon called, doing nothing" EOF sudo chmod 755 $TARGET_ROOT/sbin/start-stop-daemon -sudo mv $TARGET_ROOT/sbin/initctl $TARGET_ROOT/sbin/initctl.REAL -sudo dd of=$TARGET_ROOT/sbin/initctl <