From c8da7c1bb401c1483cef058f8221e31d43e65add Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Tue, 30 Mar 2010 09:34:29 +0100 Subject: [PATCH] xenserver: gate all logrotate reopens 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 --- xenserver/etc_logrotate.d_openvswitch | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xenserver/etc_logrotate.d_openvswitch b/xenserver/etc_logrotate.d_openvswitch index f87282c3..ed3592f2 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 -- 2.30.2