Skip to content

Commit

Permalink
Properly reopen python daemon log files after rotation.
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
blp committed May 22, 2012
1 parent ea52322 commit b54c9e9
Showing 3 changed files with 11 additions and 20 deletions.
9 changes: 3 additions & 6 deletions debian/openvswitch-switch.logrotate
Original file line number Diff line number Diff line change
@@ -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
}
11 changes: 4 additions & 7 deletions rhel/etc_logrotate.d_openvswitch
Original file line number Diff line number Diff line change
@@ -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
}
11 changes: 4 additions & 7 deletions xenserver/etc_logrotate.d_openvswitch
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit b54c9e9

Please sign in to comment.