summaryrefslogtreecommitdiff
path: root/rhel/etc_logrotate.d_openvswitch
diff options
context:
space:
mode:
authorTimothy Redaelli <tredaelli@redhat.com>2017-04-13 11:48:20 +0200
committerBen Pfaff <blp@ovn.org>2017-04-13 10:09:32 -0700
commit618a5b45ae8b4602877e625b1d15b17093e4b3f1 (patch)
treec9df0b98e535a472013cb93d9f33e6d318f605e2 /rhel/etc_logrotate.d_openvswitch
parentf848080e556f17cd8970cf1216651696d91b335e (diff)
downloadopenvswitch-618a5b45ae8b4602877e625b1d15b17093e4b3f1.tar.gz
rhel: Avoid logrotate error if /var/run/openvswitch does not exist
Avoid also errors if an ovs server didn't start correctly or it crashed without deleting the pid file. Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1441524 Signed-off-by: Timothy Redaelli <tredaelli@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'rhel/etc_logrotate.d_openvswitch')
-rw-r--r--rhel/etc_logrotate.d_openvswitch8
1 files changed, 5 insertions, 3 deletions
diff --git a/rhel/etc_logrotate.d_openvswitch b/rhel/etc_logrotate.d_openvswitch
index 914e67c04..d93a56e51 100644
--- a/rhel/etc_logrotate.d_openvswitch
+++ b/rhel/etc_logrotate.d_openvswitch
@@ -12,8 +12,10 @@
missingok
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 2>/dev/null || :
+ done
+ fi
endscript
}