From: Ian Campbell Date: Tue, 30 Mar 2010 08:34:29 +0000 (+0100) Subject: xenserver: gate all logrotate reopens on presence of a pid file X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c8da7c1bb401c1483cef058f8221e31d43e65add;p=openvswitch 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 --- 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