projects
/
snf-image
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
aac1641
)
Make helper try to umount $target on errors
author
Nikos Skalkotos
<skalkoto@grnet.gr>
Fri, 7 Oct 2011 08:40:09 +0000
(11:40 +0300)
committer
Nikos Skalkotos
<skalkoto@grnet.gr>
Fri, 7 Oct 2011 08:40:09 +0000
(11:40 +0300)
Since the mount and umount commands are tasks, if a task fails, the
filesystem may have been left mounted. For this case, I've created a
trap that tries to umount the filesystem
snf-image-helper/snf-image-helper.in
patch
|
blob
|
history
diff --git
a/snf-image-helper/snf-image-helper.in
b/snf-image-helper/snf-image-helper.in
index
d454e36
..
89e4078
100644
(file)
--- a/
snf-image-helper/snf-image-helper.in
+++ b/
snf-image-helper/snf-image-helper.in
@@
-67,6
+67,10
@@
if [ -z "$RUN_PARTS" ]; then
log_error "run-parts programe is missing from the system"
fi
+# If something goes wrong with the tasks, try to umount the target filesystem
+# in case it is left mounted...
+trap '{ umount $target; }' ERR
+
echo "Execute all snf-image tasks...."
$RUN_PARTS -v --exit-on-error "@tasksdir@"