diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-09 13:16:35 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-09 13:16:35 +0000 |
commit | e2bbf175a2184bd76f6c54ccf8456babeb1a46fc (patch) | |
tree | f0b76550d6e6f500ada964a3a4ee933a45e5a6f1 /tools/etc/logrotate.d | |
parent | Initial commit. (diff) | |
download | frr-e2bbf175a2184bd76f6c54ccf8456babeb1a46fc.tar.xz frr-e2bbf175a2184bd76f6c54ccf8456babeb1a46fc.zip |
Adding upstream version 9.1.upstream/9.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tools/etc/logrotate.d')
-rw-r--r-- | tools/etc/logrotate.d/frr | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tools/etc/logrotate.d/frr b/tools/etc/logrotate.d/frr new file mode 100644 index 0000000..735af65 --- /dev/null +++ b/tools/etc/logrotate.d/frr @@ -0,0 +1,27 @@ +/var/log/frr/*.log { + size 500k + sharedscripts + missingok + compress + rotate 14 + create 0640 frr frr + + postrotate + 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 sharpd \ + pimd pim6d ripd ripngd zebra pathd 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 +} |