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
This commit is contained in:
Russell Sim 2013-11-17 14:42:17 +11:00
parent 35830cc57c
commit b9348447b9
2 changed files with 10 additions and 6 deletions

View File

@ -5,7 +5,8 @@ set -e
[ -n "$TARGET_ROOT" ] [ -n "$TARGET_ROOT" ]
sudo mv $TARGET_ROOT/sbin/start-stop-daemon.REAL $TARGET_ROOT/sbin/start-stop-daemon sudo mv $TARGET_ROOT/sbin/start-stop-daemon.REAL $TARGET_ROOT/sbin/start-stop-daemon
if [ -f $TARGET_ROOT/sbin/initctl.REAL ]
then
sudo mv $TARGET_ROOT/sbin/initctl.REAL $TARGET_ROOT/sbin/initctl 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 sudo mv $TARGET_ROOT/usr/sbin/invoke-rc.d.REAL $TARGET_ROOT/usr/sbin/invoke-rc.d

View File

@ -13,6 +13,8 @@ echo "Warning: Fake start-stop-daemon called, doing nothing"
EOF EOF
sudo chmod 755 $TARGET_ROOT/sbin/start-stop-daemon sudo chmod 755 $TARGET_ROOT/sbin/start-stop-daemon
if [ -f $TARGET_ROOT/sbin/initctl ]
then
sudo mv $TARGET_ROOT/sbin/initctl $TARGET_ROOT/sbin/initctl.REAL sudo mv $TARGET_ROOT/sbin/initctl $TARGET_ROOT/sbin/initctl.REAL
sudo dd of=$TARGET_ROOT/sbin/initctl <<EOF sudo dd of=$TARGET_ROOT/sbin/initctl <<EOF
#!/bin/sh #!/bin/sh
@ -20,6 +22,7 @@ echo "initctl (tripleo 1.0)"
echo "Warning: Fake initctl called, doing nothing" echo "Warning: Fake initctl called, doing nothing"
EOF EOF
sudo chmod 755 $TARGET_ROOT/sbin/initctl sudo chmod 755 $TARGET_ROOT/sbin/initctl
fi
sudo mv $TARGET_ROOT/usr/sbin/invoke-rc.d $TARGET_ROOT/usr/sbin/invoke-rc.d.REAL sudo mv $TARGET_ROOT/usr/sbin/invoke-rc.d $TARGET_ROOT/usr/sbin/invoke-rc.d.REAL
sudo dd of=$TARGET_ROOT/usr/sbin/invoke-rc.d <<EOF sudo dd of=$TARGET_ROOT/usr/sbin/invoke-rc.d <<EOF