Re: [ovs-dev] [PATCH 2/2] rhel: Avoid logrotate error if /var/run/openvswitch does not exist

2017-04-13 Thread Ben Pfaff
On Thu, Apr 13, 2017 at 11:48:20AM +0200, Timothy Redaelli wrote:
> 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 

Thanks!  I applied this to master.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH 2/2] rhel: Avoid logrotate error if /var/run/openvswitch does not exist

2017-04-13 Thread Timothy Redaelli
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 
---
 rhel/etc_logrotate.d_openvswitch | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/rhel/etc_logrotate.d_openvswitch b/rhel/etc_logrotate.d_openvswitch
index 914e67c..d93a56e 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
 }
-- 
2.9.3

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev