2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 22:35:15 +00:00

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>
This commit is contained in:
Timothy Redaelli
2017-04-13 11:48:20 +02:00
committed by Ben Pfaff
parent f848080e55
commit 618a5b45ae

View File

@@ -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
}