[ovs-dev] [PATCH 3/3] xenserver: Don't reload ovs-brcompatd's log file if it's not running

Ian Campbell Ian.Campbell at citrix.com
Tue Mar 30 08:34:29 UTC 2010


On Tue, 2010-03-30 at 07:46 +0100, Ian Campbell wrote:
> I was planning to send you a very similar patch today, thanks!

Actually, my patch went a bit further and made all three appctl
invocations dependent on the relevant pid files. This probably only
makes a difference in the case where you have vswitch installed but
(deliberately) not running _and_ you happen to have ovs-* logs big
enough to be worth rotating. Very much an edge case.

Ian.
---

>From 4b076b5a115bd83c3029f744abd1639cf420e29b Mon Sep 17 00:00:00 2001
From: Ian Campbell <ian.campbell at citrix.com>
Date: Tue, 30 Mar 2010 09:33:04 +0100
Subject: [PATCH] xenserver: also gate ovs-vswitchd and ovsdb-server logrotate reopen on presence of a pid file

This probably only makes a difference in the case where you have vswitch
installed but (deliberately) not running _and_ you happen to have ovs-* logs big
enough to be worth rotating. Very much an edge case.

Signed-off-by: Ian Campbell <ian.campbell at citrix.com>
---
 xenserver/etc_logrotate.d_openvswitch |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/xenserver/etc_logrotate.d_openvswitch b/xenserver/etc_logrotate.d_openvswitch
index f87282c..ed3592f 100644
--- a/xenserver/etc_logrotate.d_openvswitch
+++ b/xenserver/etc_logrotate.d_openvswitch
@@ -10,8 +10,12 @@
 	missingok
 	postrotate
 	# Tell Open vSwitch daemons to reopen their log files
-	/usr/bin/ovs-appctl -t ovs-vswitchd vlog/reopen
-	/usr/bin/ovs-appctl -t ovsdb-server vlog/reopen
+	if [ -e /var/run/openvswitch/ovs-vswitchd.pid ]; then
+	    /usr/bin/ovs-appctl -t ovs-vswitchd vlog/reopen
+	fi
+	if [ -e /var/run/openvswitch/ovsdb-server.pid ]; then	
+	    /usr/bin/ovs-appctl -t ovsdb-server vlog/reopen
+	fi
 	if [ -e /var/run/openvswitch/ovs-brcompatd.pid ]; then
 		/usr/bin/ovs-appctl -t ovs-brcompatd vlog/reopen
 	fi
-- 
1.5.6.5







More information about the dev mailing list