]> git.proxmox.com Git - mirror_frr.git/blobdiff - debian/frr.logrotate
bgpd: Reformat bpacket_reformat_for_peer
[mirror_frr.git] / debian / frr.logrotate
index 0dd68fb257e2beee0aef9f367287d90fbab5719d..a6b2b22f561cbb0d077b2c433fe562848fa66b41 100644 (file)
@@ -7,11 +7,21 @@
         create 640 frr frrvty
 
         postrotate
-               for i in zebra bgpd ripd ospfd ripngd ospf6d isisd pimd; do
-                        if [ -e /var/run/frr/$i.pid ] ; then
-                               kill -USR1 `cat /var/run/frr/$i.pid`
-                        fi
-
-                done
+            pid=$(lsof -t -a -c /syslog/ /var/log/frr/* 2>/dev/null)
+            if [ -n "$pid" ]
+            then # using syslog
+                 kill -HUP $pid
+            fi
+            # in case using file logging; if switching back and forth
+            # between file and syslog, rsyslogd might still have file
+            # open, as well as the daemons, so always signal the daemons.
+            # It's safe, a NOP if (only) syslog is being used.
+            for i in babeld bgpd eigrpd isisd ldpd nhrpd ospf6d ospfd \
+                pimd ripd ripngd zebra pbrd staticd bfdd fabricd vrrpd; do
+                if [ -e /var/run/frr/$i.pid ] ; then
+                    pids="$pids $(cat /var/run/frr/$i.pid)"
+                fi
+            done
+            [ -n "$pids" ] && kill -USR1 $pids || true
         endscript
 }