[debian-lan-devel] [SCM] Debian-LAN development and packaging branch, master, updated. 0.6-37-g21c09fd

Andreas B. Mundt andi at debian.org
Sun Sep 2 11:23:50 UTC 2012


The following commit has been merged in the master branch:
commit 21c09fde3af71b1c881a7271a5686326cd36b20a
Author: Andreas B. Mundt <andi at debian.org>
Date:   Sun Sep 2 13:14:58 2012 +0200

    Configure dirvish banks only when installing.
    
    Do not create configuration files on softupdate, as there is no test
    if the backup partition is mounted.  Sophisticated tests would allow
    adding banks later.  It has to be checked that the backup partition
    (if there is one) has been mounted and if a vault has not yet been
    initialized.

diff --git a/fai/config/scripts/SERVER_A/70-dirvish b/fai/config/scripts/SERVER_A/70-dirvish
index 33dd1a9..5dd9521 100755
--- a/fai/config/scripts/SERVER_A/70-dirvish
+++ b/fai/config/scripts/SERVER_A/70-dirvish
@@ -9,10 +9,10 @@ BANK_DIRS="/etc /srv/fai/config /root /lan/mainserver/home0"
 
 BACKUP_DIR="/backup/"
 
-mkdir -vp $BACKUP_DIR
 fcopy -v /etc/cron.daily/backup
 rm -vf   $target/etc/cron.d/dirvish
 
+## create dirvish' master.conf:
 cat > $target/etc/dirvish/master.conf <<EOF
 bank:
    $BACKUP_DIR
@@ -23,7 +23,6 @@ exclude:
    .nfs*
 Runall:
 EOF
-
 for DIR in $BANK_DIRS ; do
     ID=`basename $DIR`
     echo "   $ID  22:00" >> $target/etc/dirvish/master.conf
@@ -39,12 +38,16 @@ expire-rule:
 #       *   *     *   *         2-7  +15 days
 EOF
 
-for DIR in $BANK_DIRS ; do
-    ID=`basename $DIR`
-    echo "Creating dirvish config $ID for $DIR."
-    mkdir -v -p  $target/$BACKUP_DIR/$ID/dirvish/
-    chmod 750 $target/$BACKUP_DIR/$ID
-    cat >     $target/$BACKUP_DIR/$ID/dirvish/default.conf <<EOF
+
+## Do the following only once when installing,
+## as /backup might not be mounted in general:
+if [ $FAI_ACTION == "install" ] ; then
+    for DIR in $BANK_DIRS ; do
+	ID=`basename $DIR`
+	echo "Creating dirvish config $ID for $DIR."
+	mkdir -v -p  $target/$BACKUP_DIR/$ID/dirvish/
+	chmod 750 $target/$BACKUP_DIR/$ID
+	cat >     $target/$BACKUP_DIR/$ID/dirvish/default.conf <<EOF
 client: $HOSTNAME
 tree: $DIR
 xdev: 1
@@ -53,11 +56,6 @@ image-default: %Y%m%d
 exclude:
 *.bak
 EOF
-done
-
-if [ $FAI_ACTION == "install" ] ; then
-    for DIR in $BANK_DIRS ; do
-	ID=`basename $DIR`
 	echo "Initialize dirvish vault $ID for $DIR:"
 	$ROOTCMD dirvish --vault $ID --init
     done

-- 
Debian-LAN development and packaging



More information about the debian-lan-devel mailing list