[Fai-commit] r4377 - trunk/bin

lange at alioth.debian.org lange at alioth.debian.org
Wed Jul 4 19:47:33 UTC 2007


Author: lange
Date: 2007-07-04 19:47:32 +0000 (Wed, 04 Jul 2007)
New Revision: 4377

Modified:
   trunk/bin/fai
Log:
during dirinstall set LOGDIR=/var/log/fai/dirinstall/$HOSTNAME (closes: 429553)


Modified: trunk/bin/fai
===================================================================
--- trunk/bin/fai	2007-07-04 18:23:43 UTC (rev 4376)
+++ trunk/bin/fai	2007-07-04 19:47:32 UTC (rev 4377)
@@ -80,12 +80,6 @@
     [ "$FAI_ROOT" = '/' ] && ROOTCMD=
     target=$FAI_ROOT
 
-    if [ X$action = Xdirinstall -a -n "$newhostname" ]; then
-	HOSTNAME=$newhostname
-	unset newhostname
-	echo "Hostname set to $HOSTNAME" | tee -a $LOGDIR/fai.log
-    fi
-
     if [ $do_init_tasks -eq 1 ]; then
         trap 'echo "Now rebooting";faireboot' INT QUIT
     else
@@ -243,8 +237,13 @@
 fi
 export start_seconds=$(cut -d . -f 1 /proc/uptime)
 
+if [ X$action = Xdirinstall -a -n "$newhostname" ]; then
+    HOSTNAME=$newhostname
+fi
+
 mkdir -p /var/run/fai
 export LOGDIR=/var/log/fai/current
+[ X$action = Xdirinstall ] && export LOGDIR=/var/log/fai/dirinstall/$HOSTNAME
 [ -d $LOGDIR ] && rm -rf $LOGDIR
 mkdir -p $LOGDIR
 
@@ -256,6 +255,8 @@
 
 fai_init
 if [ X$action = Xdirinstall ]; then
+    [ -n "$newhostname" ] && echo "Hostname set to $HOSTNAME" | tee -a $LOGDIR/fai.log
+    unset newhostname
     skiptask confdir
     export FAI=$FAI_CONFIGDIR
     set -a




More information about the Fai-commit mailing list