From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46347) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TY2Ia-0003z6-TV for qemu-devel@nongnu.org; Mon, 12 Nov 2012 17:16:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TY2IX-0007ZJ-RB for qemu-devel@nongnu.org; Mon, 12 Nov 2012 17:16:08 -0500 Received: from mx1.redhat.com ([209.132.183.28]:20726) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TY2IX-0007ZD-H3 for qemu-devel@nongnu.org; Mon, 12 Nov 2012 17:16:05 -0500 Message-ID: <50A17520.2090608@redhat.com> Date: Mon, 12 Nov 2012 15:16:00 -0700 From: Eric Blake MIME-Version: 1.0 References: <20121112093249.20398.8232.stgit@melchior2.sdl.hitachi.co.jp> <20121112093258.20398.52001.stgit@melchior2.sdl.hitachi.co.jp> In-Reply-To: <20121112093258.20398.52001.stgit@melchior2.sdl.hitachi.co.jp> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigAECDFC40AA90875E4B964ACD" 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: Tomoki Sekiyama Cc: qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigAECDFC40AA90875E4B964ACD Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 snapsh= ot >=20 > Signed-off-by: Tomoki Sekiyama > --- > +LOGFILE=3D/var/log/qga-fsreeze-hook.log s/fsreeze/fsfreeze/ > +# Iterate executables in directory "fsfreeze-hook.d" with the specifie= d 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=3D$? > + echo $(date) ": $file finished with status=3D$STATUS" >>$LOGFILE and again. > + INNODB_STATUS=3D$(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_STA= TUS 'echo' cannot portably be used with \. Use 'printf' instead. --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enigAECDFC40AA90875E4B964ACD Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iQEcBAEBCAAGBQJQoXUhAAoJEKeha0olJ0NqV80H/1pg89T9ejLGSXZ86A6MSRZh xRayCne/COFMK9vuD3EjcxLgjRuov3+N/+BQeL3CKowdE/CCdG8f0UTzERz+shnT birdX5FTwkQOgbxRCFjzeo0bdtpB481n2paypDWFAQhcc81XxWyph5+ugOV71Qf1 pQwSvlI+VypHbhktF0whFqgzs+EkYPpPLKj7Yc7g6uKa8iBEZEMBh34X+j04r6fd bKEcjE+6Gfr4V2W48z1yuxk/OkoeyDfksnEtX8iU+yahYCMJkN4xShNUOQzS7mmb oR6Wzo9UOHPYlvDiQ+P/EvxTEeyzv1x/bTtww93eQNNGNH8TQS+2rlFhXdT+kZc= =ENyi -----END PGP SIGNATURE----- --------------enigAECDFC40AA90875E4B964ACD--