[debian-lan-devel] [debian-lan] 04/06: Move the setup of the chroots to extra script, add note in motd.

Andreas B. Mundt andi at moszumanska.debian.org
Wed Aug 27 09:00:19 UTC 2014


This is an automated email from the git hooks/post-receive script.

andi pushed a commit to branch master
in repository debian-lan.

commit 0c4076e99355afd53fd749302b203f208a11f037
Author: Andreas B. Mundt <andi at debian.org>
Date:   Sat Aug 9 13:03:23 2014 +0200

    Move the setup of the chroots to extra script, add note in motd.
---
 fai/config/files/etc/motd/SERVER_A                   |  5 +++++
 .../local/sbin/debian-lan-chroots}/FAISERVER         | 20 ++------------------
 fai/config/scripts/FAISERVER/10-config               | 11 ++++++-----
 3 files changed, 13 insertions(+), 23 deletions(-)

diff --git a/fai/config/files/etc/motd/SERVER_A b/fai/config/files/etc/motd/SERVER_A
index d3e4a0f..ab453d2 100644
--- a/fai/config/files/etc/motd/SERVER_A
+++ b/fai/config/files/etc/motd/SERVER_A
@@ -12,3 +12,8 @@ individual files in /usr/share/doc/*/copyright.
 
 Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
 permitted by applicable law.
+
+------------------------------------------------------------
+   Run 'debian-lan-chroots' to create/update the nfsroot
+   for FAI and/or the chroot for diskless clients.
+------------------------------------------------------------
diff --git a/fai/config/files/etc/rc.local/FAISERVER b/fai/config/files/usr/local/sbin/debian-lan-chroots/FAISERVER
similarity index 87%
rename from fai/config/files/etc/rc.local/FAISERVER
rename to fai/config/files/usr/local/sbin/debian-lan-chroots/FAISERVER
index 910d960..ac4e921 100755
--- a/fai/config/files/etc/rc.local/FAISERVER
+++ b/fai/config/files/usr/local/sbin/debian-lan-chroots/FAISERVER
@@ -7,7 +7,6 @@ umask 0022
 export http_proxy="http://aptcache:3128"
 
 ############################
-TIMEOUT=120
 URL="http.debian.net"
 INSTALLER="/usr/lib/debian-installer/images/*/*/text/debian-installer/"
 
@@ -166,15 +165,7 @@ EOF
 munin-node-configure --shell 2>/dev/null | sh && sed -i "s%\(^munin-node-configure\)%\#\1%" $0
 
 ## Setup/update nfsroot for FAI:
-cat <<EOF
-================================================================================
-The nfsroot for FAI may be created/updated by executing $0.
-This can be done now, later or manually.
-Internet access is needed to download packages.
-If unanswered, this script will exit after $TIMEOUT seconds.
-
-EOF
-read -e -t $TIMEOUT -n 1 -p "Install/update the nfsroot for FAI now? [y|N]: " inp
+read -e -n 1 -p "Install/update the nfsroot for FAI now? [y|N]: " inp
 if [ "$inp" = "y" ] ; then
     check_network
     setup_nfsroot
@@ -187,14 +178,7 @@ exit 0  ##DISKLESS_SERVER##
 
 if [ -d $NFSROOT ] && [ -n "$(ls -A $NFSROOT)" ] ; then
     ## Setup/update chroot for diskless machines:
-    cat <<EOF
-================================================================================
-The chroot for diskless clients may be installed/updated.
-This can be done right now, later or manually by executing $0.
-If unanswered, this script will exit after $TIMEOUT seconds.
-
-EOF
-    read -e -t $TIMEOUT -n 1 -p "Install/update the chroot for diskless clients now? [y|N]: " inp
+    read -e -n 1 -p "Install/update the chroot for diskless clients now? [y|N]: " inp
     if [ "$inp" = "y" ] ; then
         check_network
         setup_diskless
diff --git a/fai/config/scripts/FAISERVER/10-config b/fai/config/scripts/FAISERVER/10-config
index b8288ed..ca3bbe0 100755
--- a/fai/config/scripts/FAISERVER/10-config
+++ b/fai/config/scripts/FAISERVER/10-config
@@ -6,13 +6,14 @@ fcopy -r /etc/fai
 
 if [ "$FAI_ACTION" == "install" ] || [ "$CONVERT" == "true" ] ; then
     ## fetch template and insert 'number' of workstations:
-    fcopy  /etc/rc.local
-    sed -i "s/WS_RANGE/${WS_RANGE}/g" $target/etc/rc.local
-    sed -i "s/DL_RANGE/${DL_RANGE}/g" $target/etc/rc.local
+    FILE="/usr/local/sbin/debian-lan-chroots"
+    fcopy $FILE
+    sed -i "s/WS_RANGE/${WS_RANGE}/g" ${target}$FILE
+    sed -i "s/DL_RANGE/${DL_RANGE}/g" ${target}$FILE
     PREFIX=`echo $SUBNET | cut -d "." --fields=1,2,3`
-    sed -i "s/PREFIX/${PREFIX}/g" $target/etc/rc.local
+    sed -i "s/PREFIX/${PREFIX}/g" ${target}$FILE
 
     if ifclass DISKLESS_SERVER ; then
-	sed -i "s%\(^.*\#\#DISKLESS_SERVER\#\#\)%\#\1%"  $target/etc/rc.local
+	sed -i "s%\(^.*\#\#DISKLESS_SERVER\#\#\)%\#\1%"  ${target}$FILE
     fi
 fi

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/debian-lan.git



More information about the debian-lan-devel mailing list