aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGurucharan Shetty <gshetty@nicira.com>2013-04-06 16:56:06 -0700
committerGurucharan Shetty <gshetty@nicira.com>2013-04-07 09:02:40 -0700
commitbc7f6c4709b0acae1fca98777f18287cd45c13d6 (patch)
tree39749a4d3431cfde415119e8943ac64762263fe6
parent8fb7eddbcd1a487a883d6c3d96525a944b5a43f0 (diff)
ovs-lib: Do not tee the ovs-ctl o/p in case of strace.
Running the OVS daemons with strace option enabled will block if we pipe the output. We use tee to log the output of ovs-ctl to ovs-ctl.log This patch disables the startup script logging when we run the OVS daemons with the strace option. Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
-rw-r--r--utilities/ovs-lib.in14
1 files changed, 12 insertions, 2 deletions
diff --git a/utilities/ovs-lib.in b/utilities/ovs-lib.in
index a441c3d0..f7b5bd47 100644
--- a/utilities/ovs-lib.in
+++ b/utilities/ovs-lib.in
@@ -38,8 +38,18 @@ else
fi
ovs_ctl () {
- echo "`date -u`:$@" >> "${logdir}/ovs-ctl.log"
- "${datadir}/scripts/ovs-ctl" "$@" 2>&1 | tee -a "${logdir}/ovs-ctl.log"
+ case "$@" in
+ *"=strace"*)
+ # In case of running the daemon with strace, piping the o/p causes
+ # the script to block (strace probably does not close the inherited
+ # pipe). So, do not log the o/p to ovs-ctl.log.
+ "${datadir}/scripts/ovs-ctl" "$@"
+ ;;
+ *)
+ echo "`date -u`:$@" >> "${logdir}/ovs-ctl.log"
+ "${datadir}/scripts/ovs-ctl" "$@" 2>&1 | tee -a "${logdir}/ovs-ctl.log"
+ ;;
+ esac
}
VERSION='@VERSION@'