From bbf219ef584a102fde5150defab3a769a6a44981 Mon Sep 17 00:00:00 2001 From: Numan Siddique Date: Wed, 8 Nov 2017 14:29:07 +0530 Subject: 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 Signed-off-by: Numan Siddique Signed-off-by: Ben Pfaff Acked-by: Mark Michelson --- rhel/etc_logrotate.d_openvswitch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'rhel/etc_logrotate.d_openvswitch') 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 -- cgit v1.2.1