Setting tag sliver-openvswitch-2.2.90-1
[sliver-openvswitch.git] / debian / openvswitch-switch.logrotate
index 3da57e0..a7a71bd 100644 (file)
@@ -1,11 +1,16 @@
-/var/log/openvswitch/ovs-openflowd.log {
-        daily
-        compress
-        create 640 root adm
-        delaycompress
-        missingok
-        rotate 30
-        postrotate
-                ovs-appctl --target=ovs-openflowd vlog/reopen
-        endscript
+/var/log/openvswitch/*.log {
+    daily
+    compress
+    create 640 root adm
+    delaycompress
+    missingok
+    rotate 30
+    postrotate
+    # Tell Open vSwitch daemons to reopen their log files
+    if [ -d /var/run/openvswitch ]; then
+        for pidfile in `cd /var/run/openvswitch && echo *.pid`; do
+            ovs-appctl -t "${pidfile%%.pid}" vlog/reopen
+        done
+    fi
+    endscript
 }