From: Ben Pfaff Date: Tue, 1 May 2012 21:27:06 +0000 (-0700) Subject: Properly reopen python daemon log files after rotation. X-Git-Tag: sliver-openvswitch-1.8.90-0~48^2~414 X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=b54c9e972e74ed51ce8a6d0a071f253f48432d6c Properly reopen python daemon log files after rotation. The OVS Python daemons weren't reopening their log files after rotation, so all the log information after the second rotation was lost. Signed-off-by: Ben Pfaff --- diff --git a/debian/openvswitch-switch.logrotate b/debian/openvswitch-switch.logrotate index 6620a0944..8b042407e 100644 --- a/debian/openvswitch-switch.logrotate +++ b/debian/openvswitch-switch.logrotate @@ -7,11 +7,8 @@ rotate 30 postrotate # Tell Open vSwitch daemons to reopen their log files - if [ -e /var/run/openvswitch/ovs-vswitchd.pid ]; then - ovs-appctl -t ovs-vswitchd vlog/reopen - fi - if [ -e /var/run/openvswitch/ovsdb-server.pid ]; then - ovs-appctl -t ovsdb-server vlog/reopen - fi + for pidfile in `cd /var/run/openvswitch && echo *.pid`; do + ovs-appctl -t "${pidfile%%.pid}" vlog/reopen + done endscript } diff --git a/rhel/etc_logrotate.d_openvswitch b/rhel/etc_logrotate.d_openvswitch index 2fdd6c465..46b94b9f6 100644 --- a/rhel/etc_logrotate.d_openvswitch +++ b/rhel/etc_logrotate.d_openvswitch @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Nicira, Inc. +# Copyright (C) 2009, 2010, 2011, 2012 Nicira, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright @@ -10,11 +10,8 @@ missingok postrotate # Tell Open vSwitch daemons to reopen their log files - 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 + for pidfile in `cd /var/run/openvswitch && echo *.pid`; do + ovs-appctl -t "${pidfile%%.pid}" vlog/reopen + done endscript } diff --git a/xenserver/etc_logrotate.d_openvswitch b/xenserver/etc_logrotate.d_openvswitch index a677ca6ea..46b94b9f6 100644 --- a/xenserver/etc_logrotate.d_openvswitch +++ b/xenserver/etc_logrotate.d_openvswitch @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Nicira, Inc. +# Copyright (C) 2009, 2010, 2011, 2012 Nicira, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright @@ -10,11 +10,8 @@ missingok postrotate # Tell Open vSwitch daemons to reopen their log files - 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 + for pidfile in `cd /var/run/openvswitch && echo *.pid`; do + ovs-appctl -t "${pidfile%%.pid}" vlog/reopen + done endscript }