1
0
mirror of synced 2026-04-15 23:51:03 +00:00

2007-06-13 23:07:11 by steve

Updated to use policy-rc.d in the common.sh.
This commit is contained in:
steve
2007-06-13 23:07:12 +00:00
parent 0b8cd87ab3
commit 5b1c1855ba
2 changed files with 25 additions and 3 deletions

View File

@@ -20,6 +20,9 @@ Contributions
Edd Dumbill <edd [at] com.usefulinc>
- Contributed APT sources.list file for Ubuntus Dapper release.
Stefan Fritsch <sf [at] de.sfritsch>
- Contributed the policy-rc.d fixups for common.sh
Sven Hertge <sven [at] de.svenhartge>
- Bugfix for Debian/Gentoo package installation.

View File

@@ -8,6 +8,9 @@
# This script also includes a logging utility which you're encouraged
# to use.
#
# The routines here may be freely called from any role script(s) you
# might develop.
#
# Steve
# --
#
@@ -54,6 +57,9 @@ assert ()
#
# Install a Debian package via apt-get.
#
# We take special care so that daemons shouldn't start after installation
# which they might otherwise do.
#
installDebianPackage ()
{
prefix=$1
@@ -76,7 +82,15 @@ installDebianPackage ()
assert "$LINENO" -d ${prefix}
#
# Disable the start-stop-daemon
# Use policy-rc to stop any daemons from starting.
#
echo -e '#!/bin/bash\nexit 101\n' > ${prefix}/usr/sbin/policy-rc.d
chmod +x ${prefix}/usr/sbin/policy-rc.d
#
# Disable the start-stop-daemon - this shouldn't be necessary
# with the policy-rc.d addition above, however leaving it in
# place won't hurt ..
#
disableStartStopDaemon ${prefix}
@@ -85,6 +99,11 @@ installDebianPackage ()
#
DEBIAN_FRONTEND=noninteractive chroot ${prefix} /usr/bin/apt-get --yes --force-yes install ${package}
#
# Remove the policy-rc.d script.
#
rm -f ${prefix}/usr/sbin/policy-rc.d
#
# Re-enable the start-stop-daemon
#
@@ -108,7 +127,7 @@ disableStartStopDaemon ()
echo "echo \"Warning: Fake start-stop-daemon called, doing nothing\"" >> "${daemonfile}"
chmod 755 "${daemonfile}"
logMessage "Start Stop Daemon disabled off."
logMessage "start-stop-daemon disabled / made a stub."
}
@@ -127,7 +146,7 @@ enableStartStopDaemon ()
#
if [ -e "${daemonfile}.REAL" ]; then
mv "${daemonfile}.REAL" "${daemonfile}"
logMessage "Start Stop Daemon enabled on."
logMessage "start-stop-daemon restored to working order."
fi
}