[Fai-commit] r3930 - trunk/bin
fai-commit at lists.alioth.debian.org
fai-commit at lists.alioth.debian.org
Tue Sep 12 15:12:51 UTC 2006
Author: lange
Date: 2006-09-12 15:12:51 +0000 (Tue, 12 Sep 2006)
New Revision: 3930
Modified:
trunk/bin/fai
Log:
trap uses subroutine clean_exit() for dirinst
Modified: trunk/bin/fai
===================================================================
--- trunk/bin/fai 2006-09-12 14:31:14 UTC (rev 3929)
+++ trunk/bin/fai 2006-09-12 15:12:51 UTC (rev 3930)
@@ -81,9 +81,9 @@
target=$FAI_ROOT
if [ $do_init_tasks -eq 1 ]; then
- trap 'echo "Now rebooting";faireboot' INT QUIT ;
+ trap 'echo "Now rebooting";faireboot' INT QUIT
else
- trap "echo 'Aborted';rm -f $stamp" INT QUIT ;
+ trap "echo 'Aborted';rm -f $stamp" INT QUIT
fi
if [ $do_init_tasks -eq 1 ]; then
@@ -245,7 +245,15 @@
if [ X$action = Xdirinst ]; then
skiptask confdir
export FAI=$FAI_CONFIGDIR
- trap 'rm -f $stamp; [ -d $targetdir/proc/self ] && umount $targetdir/proc $targetdir/sys' EXIT ;
+ set -a
+ clean_exit() {
+ rm -f $stamp
+ [ -z "$targetdir" ] && return
+ [ -d $targetdir/proc/self ] && umount $targetdir/proc $targetdir/sys
+ [ -f /etc/init.d/udev ] && umount $targetdir/dev
+ }
+ set +a
+ trap 'clean_exit' EXIT
fi
mkfifo $LOGDIR/logfifo
More information about the Fai-commit
mailing list