Skip to content

Commit

Permalink
always log output to a file
Browse files Browse the repository at this point in the history
This eliminates the risk of losing crucial debug output in a
long mkcloud run because you forgot to redirect to a file and
the terminal/screen/tmux scrollback buffer wasn't big enough.

Closes #1191.
  • Loading branch information
Adam Spiers committed Sep 7, 2016
1 parent 41562a2 commit 2a4f415
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/mkcloud
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
# 2. This tool relies on the script qa_crowbarsetup.sh
# 3. Please 'export' environment variables according to your needs.

: ${cloud:=cloud}
: ${log_dir:=/var/log/mkcloud/$cloud}
mkdir -p "$log_dir"
log_file=$log_dir/`date -Iseconds`.log
exec > >(tee -ia $log_file)
exec 2> >(tee -ia $log_file >&2)

if [[ $debug_mkcloud = 1 ]] ; then
set -x
Expand Down Expand Up @@ -88,7 +94,6 @@ cpuflags=''
working_dir_orig=`pwd`
: ${artifacts_dir:=$working_dir_orig/.artifacts}
start_time=`date`
: ${cloud:=cloud}
: ${cloudvg:=cloud}
needcvol=1
: ${vdisk_dir:=/dev/$cloudvg}
Expand Down

0 comments on commit 2a4f415

Please sign in to comment.