[debian-lan-devel] [SCM] Debian-LAN development and packaging branch, squeeze, updated. 0.7squeeze-4-g6d26972

Andreas B. Mundt andi at debian.org
Sat Jan 26 13:58:12 UTC 2013


The following commit has been merged in the squeeze branch:
commit 6d26972022757ee5ba21a1e97dae73745b4964a6
Author: Andreas B. Mundt <andi at debian.org>
Date:   Sat Jan 26 11:06:31 2013 +0100

    Add hook to disable services when converting.  Create directories.
    
    The hook checks if a minimal installation is going to be converted
    and disables the start of services in that case.  Necessary
    directories are created.
    
    Cf. <URL:http://wiki.debian.org/DebianLAN/bootstrap> for instructions.
    (cherry picked from commit dda859b83a98f62c702d8319087c8ea36cf2de2f)

diff --git a/fai/config/hooks/instsoft.SERVER_A.source b/fai/config/hooks/instsoft.SERVER_A.source
new file mode 100755
index 0000000..c46f915
--- /dev/null
+++ b/fai/config/hooks/instsoft.SERVER_A.source
@@ -0,0 +1,20 @@
+#! /bin/bash
+#
+#  Disable services when converting a minimal installation.
+#  Create necessary directories if missing.
+
+
+POLICYFILE="/usr/sbin/policy-rc.d"
+
+## Only do that when converting:
+if [ $CONVERT ] && [ "$target" == "/" ] && [ ! -e $POLICYFILE ] ; then
+    cat > $POLICYFILE <<EOF
+#!/bin/sh
+exit 101
+EOF
+    chmod a+rx $POLICYFILE
+    mkdir -p /var/lib/fai/config
+    mkdir -p /lan/mainserver/home0
+else
+    unset POLICYFILE
+fi
diff --git a/fai/config/hooks/tests.SERVER_A.source b/fai/config/hooks/tests.SERVER_A.source
index 4fe40d7..932c548 100755
--- a/fai/config/hooks/tests.SERVER_A.source
+++ b/fai/config/hooks/tests.SERVER_A.source
@@ -1,6 +1,16 @@
 #!/bin/bash
 #
-# run etckeeper
+#
+
+#
+# Enable services again when converting a minimal installation.
+# Only do that when converting:
+if [ -n "$POLICYFILE" ] ; then
+    rm $POLICYFILE
+fi
+
+#
+# Run etckeeper:
 #
 
 $ROOTCMD etckeeper commit "saving modifications after configure scripts run" || true

-- 
Debian-LAN development and packaging



More information about the debian-lan-devel mailing list