summaryrefslogtreecommitdiff
path: root/rhel/etc_logrotate.d_openvswitch
diff options
context:
space:
mode:
authorNuman Siddique <nusiddiq@redhat.com>2017-11-08 14:29:07 +0530
committerBen Pfaff <blp@ovn.org>2017-11-26 16:32:12 -0800
commitbbf219ef584a102fde5150defab3a769a6a44981 (patch)
treeed367ff8a696153844caf1e9569bf9d64b4ff9d1 /rhel/etc_logrotate.d_openvswitch
parent8c8a8209ffad675dd50cfd64716ef579f57d1ae8 (diff)
downloadopenvswitch-bbf219ef584a102fde5150defab3a769a6a44981.tar.gz
OpenvSwitch logrotate: Use ctl file path as target in ovs-appctl to reset logs
Presently, logrotate script, searches for the pid files in /var/log/openvswitch and passes the pid file name (without .pid) as target to ovs-appctl. This approach doesn't work for OVN DB servers since the ctl files are generated as "ovnnb_db.ctl" and "ovnsb_db.ctl". So search for the .ctl files instead and use them as target to ovs-appctl. Suggested-by: Ben Pfaff <blp@ovn.org> Signed-off-by: Numan Siddique <nusiddiq@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Mark Michelson <mmichels@redhat.com>
Diffstat (limited to 'rhel/etc_logrotate.d_openvswitch')
-rw-r--r--rhel/etc_logrotate.d_openvswitch4
1 files changed, 2 insertions, 2 deletions
diff --git a/rhel/etc_logrotate.d_openvswitch b/rhel/etc_logrotate.d_openvswitch
index d93a56e51..ed7d733c9 100644
--- a/rhel/etc_logrotate.d_openvswitch
+++ b/rhel/etc_logrotate.d_openvswitch
@@ -13,8 +13,8 @@
postrotate
# Tell Open vSwitch daemons to reopen their log files
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 || :
+ for ctl in /var/run/openvswitch/*.ctl; do
+ ovs-appctl -t "$ctl" vlog/reopen 2>/dev/null || :
done
fi
endscript