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

Andreas B. Mundt andi at debian.org
Sun Feb 17 15:56:33 UTC 2013


The following commit has been merged in the master branch:
commit 67adb613ee85b7da32e24c8f5edb5960bef4ab5e
Author: Andreas B. Mundt <andi at debian.org>
Date:   Sat Feb 16 19:32:25 2013 +0100

    Move code prompting for 'admin' password to script.  Minor fixes.
    
    As the 'admin' password is only used in 10-slapd-KDC, move the code
    prompting for the password to this script.  This also solves the need
    to be available when converting an installation (no install.-hook is
    run in that case).
    The dialog package needs to be available when converting.
    Do not report failure when the file to be moved does not exist.

diff --git a/debian/README.Debian b/debian/README.Debian
index f83bd51..e2dc12d 100644
--- a/debian/README.Debian
+++ b/debian/README.Debian
@@ -50,7 +50,7 @@ hostname.  Prepare appropriate partitions, examples are available in
 Then convert the installation with the following commands:
 
    aptitude install debian-lan-config  # might be already installed
-   aptitude -R install fai-server      # no recommends needed
+   aptitude -R install fai-server dialog  # no recommends needed
    mkdir /srv/fai/
    cp -r /usr/share/debian-lan-config/fai/config /srv/fai/
 
diff --git a/fai/config/files/var/www/index.html/GOSA b/fai/config/files/var/www/index.html/GOSA
index 60e2f28..952824f 100644
--- a/fai/config/files/var/www/index.html/GOSA
+++ b/fai/config/files/var/www/index.html/GOSA
@@ -9,4 +9,4 @@
 </ul>
 For more information, take a look at the
 <a href="http://wiki.debian.org/DebianLAN">Debian-LAN Wiki</a>.
-x</body></html>
+</body></html>
diff --git a/fai/config/hooks/install.GOSA.source b/fai/config/hooks/install.GOSA.source
deleted file mode 100755
index 6ed8b6e..0000000
--- a/fai/config/hooks/install.GOSA.source
+++ /dev/null
@@ -1,23 +0,0 @@
-#! /bin/bash
-#
-#  Prompt for the admin password if $ADMINPW is empty.
-#
-
-if [ -n "$ADMINPW" ] ; then
-    echo "Admin password is set."
-else
-    while [ -z "$ADMINPW" ] ; do
-        if ! { inp1=$(dialog --insecure --stdout --backtitle " Admin Password " --passwordbox \
-            "There is no password for 'admin' available. \nPlease enter a password for 'admin':" 10 47) &&
-                inp2=$(dialog --insecure --stdout --backtitle " Admin Password " --passwordbox \
-                    "Please enter the password for 'admin' again:" 9 48); } ; then
-            dialog --stdout --msgbox "Entering passwords canceled, please try again." 5 50
-        elif [ "$inp1" == "$inp2" ] ; then
-            ADMINPW=$inp1
-            echo "Password for admin set."
-        else
-            dialog --stdout --msgbox "Passwords do not match, please try again." 5 45
-        fi
-        unset inp1 inp2
-    done
-fi
diff --git a/fai/config/scripts/KDC_LDAP/10-slapd-KDC b/fai/config/scripts/KDC_LDAP/10-slapd-KDC
index 291aad1..c99dbcb 100755
--- a/fai/config/scripts/KDC_LDAP/10-slapd-KDC
+++ b/fai/config/scripts/KDC_LDAP/10-slapd-KDC
@@ -58,6 +58,28 @@ copy_example_DB_CONFIG() {
         fi
 }
 
+## Prompt for 'admin' password
+adminPW() {
+    if [ -n "$ADMINPW" ] ; then
+	echo "Admin password is set."
+    else
+	while [ -z "$ADMINPW" ] ; do
+            if ! { inp1=$(dialog --insecure --stdout --backtitle " Admin Password " --passwordbox \
+		"There is no password for 'admin' available. \nPlease enter a password for 'admin':" 10 47) &&
+                    inp2=$(dialog --insecure --stdout --backtitle " Admin Password " --passwordbox \
+			"Please enter the password for 'admin' again:" 9 48); } ; then
+		dialog --stdout --msgbox "Entering passwords canceled, please try again." 5 50
+            elif [ "$inp1" == "$inp2" ] ; then
+		ADMINPW=$inp1
+		echo "Password for admin set."
+            else
+		dialog --stdout --msgbox "Passwords do not match, please try again." 5 45
+            fi
+            unset inp1 inp2
+	done
+    fi
+}
+
 ## Init LDAP tree
 init_LDAP () {
     $ROOTCMD rm -f /var/lib/ldap/*
@@ -74,8 +96,10 @@ init_LDAP () {
     echo -n $LDAP_ADMIN_PW > $target$PWFILE
     $ROOTCMD chmod -v 0600 $PWFILE
     LDAP_ADMIN_PW_HASH=`$ROOTCMD slappasswd -v -s $LDAP_ADMIN_PW -h {SSHA}`
-    ADMIN_PW_HASH=`$ROOTCMD slappasswd -v -s "$ADMINPW" -h {SSHA}`
-
+    if ifclass GOSA ; then
+	adminPW
+	ADMIN_PW_HASH=`$ROOTCMD slappasswd -v -s "$ADMINPW" -h {SSHA}`
+    fi
     #### Kerberos KDC service principals:
     KDCCONFDIR="/etc/krb5kdc/"
     KEYFILE="service.keyfile"
diff --git a/fai/config/scripts/LOG_SERVER/10-rsyslog_icinga.conf b/fai/config/scripts/LOG_SERVER/10-rsyslog_icinga.conf
index 16f416a..41b73b2 100755
--- a/fai/config/scripts/LOG_SERVER/10-rsyslog_icinga.conf
+++ b/fai/config/scripts/LOG_SERVER/10-rsyslog_icinga.conf
@@ -13,5 +13,5 @@ fcopy /etc/icinga/objects/commands.cfg
 if [ "$FAI_ACTION" == "install" ] || [ "$CONVERT" == "true" ] ; then
     ## Machines are added here, so do not overwrite them on softupdate:
     fcopy /etc/icinga/objects/hosts.cfg
-    mv $target/etc/icinga/objects/localhost_icinga.cfg $target/etc/icinga/objects/localhost_icinga.cfg_orig
+    mv $target/etc/icinga/objects/localhost_icinga.cfg $target/etc/icinga/objects/localhost_icinga.cfg_orig || true
 fi

-- 
Debian-LAN development and packaging



More information about the debian-lan-devel mailing list