[Fai-commit] r5981 - in branches/stable/3.4: bin debian lib

Michael Prokop mika at alioth.debian.org
Tue Aug 17 12:53:52 UTC 2010


Author: mika
Date: 2010-08-17 12:53:52 +0000 (Tue, 17 Aug 2010)
New Revision: 5981

Modified:
   branches/stable/3.4/bin/fai
   branches/stable/3.4/debian/changelog
   branches/stable/3.4/lib/subroutines
Log:
subroutines, fai: make sure fai exits with the according return code of task action (and all the hooks behind it)


Signed-off-by: Michael Prokop <mika at grml.org>

Modified: branches/stable/3.4/bin/fai
===================================================================
--- branches/stable/3.4/bin/fai	2010-08-17 12:53:49 UTC (rev 5980)
+++ branches/stable/3.4/bin/fai	2010-08-17 12:53:52 UTC (rev 5981)
@@ -307,7 +307,9 @@
 [ "$action" ] && export FAI_ACTION=$action
 unset action
 task action 2>&1 | tee -a $LOGDIR/fai.log
+final_exit_code=${PIPESTATUS[0]}
 
 [ -L "/var/run/fai/current_config" ] && rm -f "/var/run/fai/current_config"
 
 echo "End of $0"
+exit $final_exit_code

Modified: branches/stable/3.4/debian/changelog
===================================================================
--- branches/stable/3.4/debian/changelog	2010-08-17 12:53:49 UTC (rev 5980)
+++ branches/stable/3.4/debian/changelog	2010-08-17 12:53:52 UTC (rev 5981)
@@ -23,6 +23,10 @@
   * control: Move setup-storage to its own package (fai-setup-storage). Thanks
     Michael Prokop <mika at debian.org> for the patch (closes: #575812)
 
+  [ Michael Prokop ]
+  * subroutines, fai: make sure fai exits with the according return
+    code of task action (and all the hooks behind it)
+
  -- Thomas Lange <lange at debian.org>  Fri, 25 Jun 2010 14:29:10 +0200
 
 fai (3.3.5) unstable; urgency=high

Modified: branches/stable/3.4/lib/subroutines
===================================================================
--- branches/stable/3.4/lib/subroutines	2010-08-17 12:53:49 UTC (rev 5980)
+++ branches/stable/3.4/lib/subroutines	2010-08-17 12:53:52 UTC (rev 5981)
@@ -155,7 +155,9 @@
 	task_error_func=''
 	task_$taskname
 	sendmon "TASKEND $taskname $task_error"
-	[ "$task_error" -ne 0 ] && echo "Exit code task_$taskname: $task_error"
+        if [ "$task_error" -ne 0 ] ; then
+          echo "Exit code task_$taskname: $task_error"
+        fi
     fi
 }
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -




More information about the Fai-commit mailing list