From 618a5b45ae8b4602877e625b1d15b17093e4b3f1 Mon Sep 17 00:00:00 2001 From: Timothy Redaelli Date: Thu, 13 Apr 2017 11:48:20 +0200 Subject: 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 Signed-off-by: Ben Pfaff --- rhel/etc_logrotate.d_openvswitch | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'rhel/etc_logrotate.d_openvswitch') 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 } -- cgit v1.2.1