From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36584) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TY8Qx-00056m-Rd for qemu-devel@nongnu.org; Mon, 12 Nov 2012 23:49:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TY8Qu-00018s-PV for qemu-devel@nongnu.org; Mon, 12 Nov 2012 23:49:11 -0500 Received: from mail7.hitachi.co.jp ([133.145.228.42]:33899) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TY8Qu-00012N-9J for qemu-devel@nongnu.org; Mon, 12 Nov 2012 23:49:08 -0500 Message-ID: <50A1D163.5090505@hitachi.com> Date: Tue, 13 Nov 2012 13:49:39 +0900 From: Tomoki Sekiyama MIME-Version: 1.0 References: <20121112093249.20398.8232.stgit@melchior2.sdl.hitachi.co.jp> <20121112093258.20398.52001.stgit@melchior2.sdl.hitachi.co.jp> <50A17520.2090608@redhat.com> In-Reply-To: <50A17520.2090608@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 2/2] qemu-ga: sample fsfreeze hooks List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: eblake@redhat.com Cc: qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com Hi Eric, thank you for the review again. On 2012/11/13 7:16, Eric Blake wrote: > On 11/12/2012 02:32 AM, Tomoki Sekiyama wrote: >> Adds sample hook scripts for --fsfreeze-hook option of qemu-ga. >> - fsfreeze-hook : execute scripts in fsfreeze-hook.d/ >> - fsfreeze-hook.d.sample/mysql-flush.sh : quiesce MySQL before snapshot >> >> Signed-off-by: Tomoki Sekiyama >> --- > >> +LOGFILE=/var/log/qga-fsreeze-hook.log > > s/fsreeze/fsfreeze/ Oops... >> +# Iterate executables in directory "fsfreeze-hook.d" with the specified args >> +[ ! -d "$FSFREEZE_D" ] && exit 1 >> +for file in "$FSFREEZE_D"/* ; do >> + is_ignored_file "$file" && continue >> + [ -x "$file" ] || continue >> + echo $(date) ": execute $file $@" >>$LOGFILE > > Put $(date) inside the ""; otherwise, single-digit days will be one > character shorter due to IFS field splitting eating the double-space; > and I don't like unaligned dates in logs. > >> + "$file" "$@" >>$LOGFILE 2>&1 >> + STATUS=$? >> + echo $(date) ": $file finished with status=$STATUS" >>$LOGFILE > > and again. I will fix this. >> + INNODB_STATUS=$(mktemp /tmp/mysql-flush.XXXXXX) >> + [ $? -ne 0 ] && exit 2 >> + trap "rm -f $INNODB_STATUS" SIGINT >> + while :; do >> + echo 'SHOW ENGINE INNODB STATUS \G' | $MYSQL > $INNODB_STATUS > > 'echo' cannot portably be used with \. Use 'printf' instead. OK, I replace this with 'printf' (also in 'flush_and_wait' function). -- Tomoki Sekiyama Linux Technology Center Hitachi, Ltd., Yokohama Research Laboratory