[debian-lan-devel] [SCM] Debian-LAN development and packaging branch, master, updated. 0.7-12-gdda859b

Andreas B. Mundt andi at debian.org
Sat Jan 26 13:51:52 UTC 2013


The following commit has been merged in the master branch:
commit dda859b83a98f62c702d8319087c8ea36cf2de2f
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.

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