2007-06-12 12:57:19 by steve
Use policy-rc.d to disable daemons from running inside the chroot().
This commit is contained in:
2
debian/changelog
vendored
2
debian/changelog
vendored
@@ -5,6 +5,8 @@ xen-tools (3.4-2) unstable; urgency=low
|
||||
* Allow per-dist mirrors. Which is useful when working with mixed
|
||||
Debian + Ubuntu installations.
|
||||
* Added support for Ubuntu Feisty + Gutsy
|
||||
* Use "policy-rc.d" to prevent daemons from starting inside our
|
||||
chroot().
|
||||
|
||||
-- Radu Spineanu <radu@debian.org> Tue, 29 May 2007 01:09:40 +0300
|
||||
|
||||
|
||||
54
hooks/dapper/01-disable-daemons
Executable file
54
hooks/dapper/01-disable-daemons
Executable file
@@ -0,0 +1,54 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# This script ensures that daemons will not be started inside our
|
||||
# chroot() installation.
|
||||
#
|
||||
# Steve
|
||||
# --
|
||||
# http://www.steve.org.uk/
|
||||
|
||||
|
||||
prefix=$1
|
||||
|
||||
|
||||
#
|
||||
# Source our common functions
|
||||
#
|
||||
if [ -e /usr/lib/xen-tools/common.sh ]; then
|
||||
. /usr/lib/xen-tools/common.sh
|
||||
else
|
||||
. ./hooks/common.sh
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
# Log our start
|
||||
#
|
||||
logMessage Script $0 starting
|
||||
|
||||
|
||||
#
|
||||
# Make sure we have a directory.
|
||||
#
|
||||
if [ ! -d "${prefix}/usr/sbin" ]; then
|
||||
|
||||
mkdir -p "${prefix}/usr/sbin"
|
||||
|
||||
logMessage "created missing directory: ${prefix}/usr/sbin"
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
# Add the script.
|
||||
#
|
||||
echo '#!/bin/sh' > ${prefix}/usr/sbin/policy-rc.d
|
||||
echo 'exit 101' >> ${prefix}/usr/sbin/policy-rc.d
|
||||
chmod 755 ${prefix}/usr/sbin/policy-rc.d
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Log our finish
|
||||
#
|
||||
logMessage Script $0 finished.
|
||||
|
||||
45
hooks/dapper/99-enable-daemons
Executable file
45
hooks/dapper/99-enable-daemons
Executable file
@@ -0,0 +1,45 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# This script removes the file which prevents daemons from running.
|
||||
#
|
||||
# Steve
|
||||
# --
|
||||
# http://www.steve.org.uk/
|
||||
|
||||
|
||||
|
||||
prefix=$1
|
||||
|
||||
|
||||
#
|
||||
# Source our common functions
|
||||
#
|
||||
if [ -e /usr/lib/xen-tools/common.sh ]; then
|
||||
. /usr/lib/xen-tools/common.sh
|
||||
else
|
||||
. ./hooks/common.sh
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
# Log our start
|
||||
#
|
||||
logMessage Script $0 starting
|
||||
|
||||
|
||||
#
|
||||
# Remove the script if present.
|
||||
#
|
||||
if [ -x "${prefix}/usr/sbin/policy-rc.d" ]; then
|
||||
|
||||
rm -f "${prefix}/usr/sbin/policy-rc.d"
|
||||
|
||||
logMessage "Removed: ${prefix}/usr/sbin/policy-rc.d"
|
||||
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
# Log our finish
|
||||
#
|
||||
logMessage Script $0 finished
|
||||
54
hooks/debian/01-disable-daemons
Executable file
54
hooks/debian/01-disable-daemons
Executable file
@@ -0,0 +1,54 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# This script ensures that daemons will not be started inside our
|
||||
# chroot() installation.
|
||||
#
|
||||
# Steve
|
||||
# --
|
||||
# http://www.steve.org.uk/
|
||||
|
||||
|
||||
prefix=$1
|
||||
|
||||
|
||||
#
|
||||
# Source our common functions
|
||||
#
|
||||
if [ -e /usr/lib/xen-tools/common.sh ]; then
|
||||
. /usr/lib/xen-tools/common.sh
|
||||
else
|
||||
. ./hooks/common.sh
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
# Log our start
|
||||
#
|
||||
logMessage Script $0 starting
|
||||
|
||||
|
||||
#
|
||||
# Make sure we have a directory.
|
||||
#
|
||||
if [ ! -d "${prefix}/usr/sbin" ]; then
|
||||
|
||||
mkdir -p "${prefix}/usr/sbin"
|
||||
|
||||
logMessage "created missing directory: ${prefix}/usr/sbin"
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
# Add the script.
|
||||
#
|
||||
echo '#!/bin/sh' > ${prefix}/usr/sbin/policy-rc.d
|
||||
echo 'exit 101' >> ${prefix}/usr/sbin/policy-rc.d
|
||||
chmod 755 ${prefix}/usr/sbin/policy-rc.d
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Log our finish
|
||||
#
|
||||
logMessage Script $0 finished.
|
||||
|
||||
45
hooks/debian/99-enable-daemons
Executable file
45
hooks/debian/99-enable-daemons
Executable file
@@ -0,0 +1,45 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# This script removes the file which prevents daemons from running.
|
||||
#
|
||||
# Steve
|
||||
# --
|
||||
# http://www.steve.org.uk/
|
||||
|
||||
|
||||
|
||||
prefix=$1
|
||||
|
||||
|
||||
#
|
||||
# Source our common functions
|
||||
#
|
||||
if [ -e /usr/lib/xen-tools/common.sh ]; then
|
||||
. /usr/lib/xen-tools/common.sh
|
||||
else
|
||||
. ./hooks/common.sh
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
# Log our start
|
||||
#
|
||||
logMessage Script $0 starting
|
||||
|
||||
|
||||
#
|
||||
# Remove the script if present.
|
||||
#
|
||||
if [ -x "${prefix}/usr/sbin/policy-rc.d" ]; then
|
||||
|
||||
rm -f "${prefix}/usr/sbin/policy-rc.d"
|
||||
|
||||
logMessage "Removed: ${prefix}/usr/sbin/policy-rc.d"
|
||||
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
# Log our finish
|
||||
#
|
||||
logMessage Script $0 finished
|
||||
54
hooks/edgy/01-disable-daemons
Executable file
54
hooks/edgy/01-disable-daemons
Executable file
@@ -0,0 +1,54 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# This script ensures that daemons will not be started inside our
|
||||
# chroot() installation.
|
||||
#
|
||||
# Steve
|
||||
# --
|
||||
# http://www.steve.org.uk/
|
||||
|
||||
|
||||
prefix=$1
|
||||
|
||||
|
||||
#
|
||||
# Source our common functions
|
||||
#
|
||||
if [ -e /usr/lib/xen-tools/common.sh ]; then
|
||||
. /usr/lib/xen-tools/common.sh
|
||||
else
|
||||
. ./hooks/common.sh
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
# Log our start
|
||||
#
|
||||
logMessage Script $0 starting
|
||||
|
||||
|
||||
#
|
||||
# Make sure we have a directory.
|
||||
#
|
||||
if [ ! -d "${prefix}/usr/sbin" ]; then
|
||||
|
||||
mkdir -p "${prefix}/usr/sbin"
|
||||
|
||||
logMessage "created missing directory: ${prefix}/usr/sbin"
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
# Add the script.
|
||||
#
|
||||
echo '#!/bin/sh' > ${prefix}/usr/sbin/policy-rc.d
|
||||
echo 'exit 101' >> ${prefix}/usr/sbin/policy-rc.d
|
||||
chmod 755 ${prefix}/usr/sbin/policy-rc.d
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Log our finish
|
||||
#
|
||||
logMessage Script $0 finished.
|
||||
|
||||
45
hooks/edgy/99-enable-daemons
Executable file
45
hooks/edgy/99-enable-daemons
Executable file
@@ -0,0 +1,45 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# This script removes the file which prevents daemons from running.
|
||||
#
|
||||
# Steve
|
||||
# --
|
||||
# http://www.steve.org.uk/
|
||||
|
||||
|
||||
|
||||
prefix=$1
|
||||
|
||||
|
||||
#
|
||||
# Source our common functions
|
||||
#
|
||||
if [ -e /usr/lib/xen-tools/common.sh ]; then
|
||||
. /usr/lib/xen-tools/common.sh
|
||||
else
|
||||
. ./hooks/common.sh
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
# Log our start
|
||||
#
|
||||
logMessage Script $0 starting
|
||||
|
||||
|
||||
#
|
||||
# Remove the script if present.
|
||||
#
|
||||
if [ -x "${prefix}/usr/sbin/policy-rc.d" ]; then
|
||||
|
||||
rm -f "${prefix}/usr/sbin/policy-rc.d"
|
||||
|
||||
logMessage "Removed: ${prefix}/usr/sbin/policy-rc.d"
|
||||
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
# Log our finish
|
||||
#
|
||||
logMessage Script $0 finished
|
||||
Reference in New Issue
Block a user