]> git.proxmox.com Git - mirror_frr.git/blob - debianpkg/frr.logrotate
Merge pull request #13649 from donaldsharp/unlock_the_node_or_else
[mirror_frr.git] / debianpkg / frr.logrotate
1 /var/log/frr/*.log {
2 size 500k
3 sharedscripts
4 missingok
5 compress
6 rotate 14
7 create 640 frr frrvty
8
9 postrotate
10 pid=$(lsof -t -a -c /syslog/ /var/log/frr/* 2>/dev/null)
11 if [ -n "$pid" ]
12 then # using syslog
13 kill -HUP $pid
14 fi
15 # in case using file logging; if switching back and forth
16 # between file and syslog, rsyslogd might still have file
17 # open, as well as the daemons, so always signal the daemons.
18 # It's safe, a NOP if (only) syslog is being used.
19 for i in babeld bgpd eigrpd isisd ldpd nhrpd ospf6d ospfd \
20 pimd ripd ripngd zebra staticd fabricd; do
21 if [ -e /var/run/frr/$i.pid ] ; then
22 pids="$pids $(cat /var/run/frr/$i.pid)"
23 fi
24 done
25 [ -n "$pids" ] && kill -USR1 $pids || true
26 endscript
27 }