Revision cc9de6c0
b/snf-image-helper/snf-image-helper.in | ||
---|---|---|
71 | 71 |
|
72 | 72 |
RUN_PARTS=$(which run-parts) |
73 | 73 |
if [ -z "$RUN_PARTS" ]; then |
74 |
log_error "run-parts programe is missing from the system"
|
|
74 |
log_error "run-parts program is missing from the system" |
|
75 | 75 |
fi |
76 | 76 |
|
77 | 77 |
# If something goes wrong with the tasks, try to umount the target filesystem |
78 | 78 |
# in case it is left mounted... |
79 | 79 |
trap '{ umount "$target"; }' ERR |
80 | 80 |
|
81 |
# Redirect standard error to standard output, |
|
82 |
# prepend a timestamp before each line of output. |
|
81 | 83 |
echo "Execute all snf-image tasks...." |
82 |
$RUN_PARTS -v --exit-on-error "@tasksdir@" |
|
84 |
$RUN_PARTS -v --exit-on-error "@tasksdir@" 2>&1| |
|
85 |
while IFS= read -r line; do |
|
86 |
echo $(date +%Y:%m:%d-%H:%M:%S.%N) "$line" |
|
87 |
done |
|
83 | 88 |
|
84 | 89 |
# Disable the trap. If code reaches here, the filesystem is unmounted. |
85 | 90 |
trap - ERR |
Also available in: Unified diff