From: Guido Günther Date: Sun, 24 Feb 2013 18:43:04 +0000 (+0100) Subject: hook: log the exit status of the hook not 256 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=c7e85db61b7f38de816bc7a7e44ec10ea1fd6fab;p=libvirt.git hook: log the exit status of the hook not 256 Adjust the docs accordingly. See http://bugs.debian.org/701570. --- diff --git a/docs/hooks.html.in b/docs/hooks.html.in index 5f9963dee3..3b070e7c52 100644 --- a/docs/hooks.html.in +++ b/docs/hooks.html.in @@ -239,13 +239,14 @@

If a hook script returns with an exit code of 0, the libvirt daemon regards this as successful and performs no logging of it.

However, if a hook script returns with a non zero exit code, the libvirt - daemon regards this as a failure, logs it with return code 256, and + daemon regards this as a failure, logs its return code, and additionally logs anything on stderr the hook script returns.

For example, a hook script might use this code to indicate failure, and send a text string to stderr:

echo "Could not find required XYZZY" >&2
 exit 1

The resulting entry in the libvirt log will appear as:

-
20:02:40.297: error : virHookCall:416 : Hook script execution failed: Hook script /etc/libvirt/hooks/qemu qemu failed with error code 256:Could not find required XYZZY
+
20:02:40.297: error : virHookCall:285 : Hook script execution failed: internal error Child process (LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+                       HOME=/root USER=root LOGNAME=root /etc/libvirt/hooks/qemu qemu prepare begin -) unexpected exit status 1: Could not find required XYZZY