summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
7393e7e)
Prepend a timestamp before every line of output of run-parts hooks,
needed as a quick-n-dirty way to estimate the time taken by each hook to
complete.
Refs #1499
RUN_PARTS=$(which run-parts)
if [ -z "$RUN_PARTS" ]; then
RUN_PARTS=$(which run-parts)
if [ -z "$RUN_PARTS" ]; then
- log_error "run-parts programe is missing from the system"
+ log_error "run-parts program 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
fi
# If something goes wrong with the tasks, try to umount the target filesystem
# in case it is left mounted...
trap '{ umount "$target"; }' ERR
+# Redirect standard error to standard output,
+# prepend a timestamp before each line of output.
echo "Execute all snf-image tasks...."
echo "Execute all snf-image tasks...."
-$RUN_PARTS -v --exit-on-error "@tasksdir@"
+$RUN_PARTS -v --exit-on-error "@tasksdir@" 2>&1|
+ while IFS= read -r line; do
+ echo $(date +%Y:%m:%d-%H:%M:%S.%N) "$line"
+ done
# Disable the trap. If code reaches here, the filesystem is unmounted.
trap - ERR
# Disable the trap. If code reaches here, the filesystem is unmounted.
trap - ERR