Properly reopen python daemon log files after rotation.
[sliver-openvswitch.git] / debian / openvswitch-switch.logrotate
index 6620a09..8b04240 100644 (file)
@@ -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
 }