# HG changeset patch # User Tim Serong <tser...@suse.com> # Date 1313069842 -36000 # Node ID 1949ea5878aa58466be5883484a3c91dbdbdc57e # Parent 1caec681e0a823874c3185b8385e70c4a29a126f RA dev guide: ocf_run: replace -v with -q
diff -r 1caec681e0a8 -r 1949ea5878aa dev-guides/ra-dev-guide.txt --- a/dev-guides/ra-dev-guide.txt Wed Feb 23 14:02:44 2011 +0100 +++ b/dev-guides/ra-dev-guide.txt Thu Aug 11 23:37:22 2011 +1000 @@ -1204,17 +1204,18 @@ With the command specified above, the re +frobnicate --spam=eggs+ and capture its output and exit code. If the exit code is nonzero (indicating an error), +ocf_run+ logs the command output with the +err+ logging severity, and -the resource agent subsequently exits. +the resource agent subsequently exits. If the exit code is zero +(indicating success), any command couput will be logged with the +info+ +logging severity. -If the resource agent wishes to capture the output of _both_ a -successful and a failed command execution, it can use the +-v+ flag -with +ocf_run+. In the example below, +ocf_run+ will log any output -from the command with the +info+ severity if the command exit code is -zero (indicating success), and with +err+ if it is nonzero. +If the resource agent wishes to ignore the output of a successful +command execution, it can use the +-q+ flag with +ocf_run+. In the +example below, +ocf_run+ will only log output if the command exit code +is nonzero. [source,bash] -------------------------------------------------------------------------- -ocf_run -v "frobnicate --spam=eggs" || exit $OCF_ERR_GENERIC +ocf_run -q "frobnicate --spam=eggs" || exit $OCF_ERR_GENERIC -------------------------------------------------------------------------- Finally, if the resource agent wants to log the output of a command _______________________________________________________ Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev Home Page: http://linux-ha.org/