debian: Avoid logrotate error if /var/run/openvswitch does not exist.
[sliver-openvswitch.git] / debian / openvswitch-switch.logrotate
index 8b04240..a7a71bd 100644 (file)
@@ -7,8 +7,10 @@
     rotate 30
     postrotate
     # Tell Open vSwitch daemons to reopen their log files
-    for pidfile in `cd /var/run/openvswitch && echo *.pid`; do
-        ovs-appctl -t "${pidfile%%.pid}" vlog/reopen
-    done
+    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
 }