[Fai-commit] r6697 - trunk/bin
Michael Prokop
mika at alioth.debian.org
Fri Oct 21 20:36:07 UTC 2011
Author: mika
Date: 2011-10-21 20:36:07 +0000 (Fri, 21 Oct 2011)
New Revision: 6697
Modified:
trunk/bin/make-fai-nfsroot
Log:
make sure we exit with actual return code of subshell
The tee usage inside "{ [...] } | tee ..." masks the return code
being executed inside the subshell. Therefore ask for pipestatus,
store its value and finally exit with this exit code.
From: Michael Prokop <mika at grml.org>
Modified: trunk/bin/make-fai-nfsroot
===================================================================
--- trunk/bin/make-fai-nfsroot 2011-10-20 15:23:12 UTC (rev 6696)
+++ trunk/bin/make-fai-nfsroot 2011-10-21 20:36:07 UTC (rev 6697)
@@ -531,6 +531,8 @@
echo "make-fai-nfsroot finished $merror."
exit $exitcode
} 2>&1 | tee -a /var/log/fai/make-fai-nfsroot.log
+RC=${PIPESTATUS[0]}
umount_dirs
trap "true" EXIT
echo "Log file written to /var/log/fai/make-fai-nfsroot.log"
+exit ${RC}
More information about the Fai-commit
mailing list