[Fai-commit] r4221 - trunk/bin

Thomas Lange lange at alioth.debian.org
Mon Jan 22 16:31:14 CET 2007


Author: lange
Date: 2007-01-22 16:31:13 +0100 (Mon, 22 Jan 2007)
New Revision: 4221

Modified:
   trunk/bin/fai-setup
Log:
do not fail (and exit) if $loguserhome is not writeable for root (closes: #407947)


Modified: trunk/bin/fai-setup
===================================================================
--- trunk/bin/fai-setup	2007-01-17 23:13:29 UTC (rev 4220)
+++ trunk/bin/fai-setup	2007-01-22 15:31:13 UTC (rev 4221)
@@ -6,7 +6,7 @@
 # fai-setup -- set up FAI
 #
 # This script is part of FAI (Fully Automatic Installation)
-# (c) 2000-2006 by Thomas Lange, lange at informatik.uni-koeln.de
+# (c) 2000-2007 by Thomas Lange, lange at informatik.uni-koeln.de
 # Universitaet zu Koeln
 #
 #*********************************************************************
@@ -74,6 +74,10 @@
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 setup_fai_account() {
 
+    # most things should be executed as user $LOGUSER, since root may not have write
+    # permissions to $loguserhome (e.g if mount via NFS without no_root_squash)
+
+    set +e
     loguserhome=$(eval "cd ~$LOGUSER 2>/dev/null && pwd;true")
     sshdir=$loguserhome/.ssh
     if [ -z "$loguserhome" ]; then
@@ -128,6 +132,7 @@
 
     logusergid=$(id -ng $LOGUSER)
     echo "User account $LOGUSER set up."
+    set -e
 }
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
@@ -140,8 +145,8 @@
 
 if [ -n "$LOGUSER" ]; then
     # chown only if cd was successful
-    cd $loguserhome && chown -R $LOGUSER:$logusergid .
-    chown -R $LOGUSER:$logusergid /srv/tftp/fai
+    cd $loguserhome && chown -R $LOGUSER:$logusergid . || true
+    chown -R $LOGUSER:$logusergid /srv/tftp/fai || true
 fi
 
 if [ -z "$FAI_CONFIGDIR" ]; then




More information about the Fai-commit mailing list