mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 15:47:22 +00:00
Merge pull request #883 from daveolson53/master
Switch to using syslog for logging as the default
This commit is contained in:
commit
d258b1df2b
22
debian/frr.logrotate
vendored
22
debian/frr.logrotate
vendored
@ -7,11 +7,21 @@
|
|||||||
create 640 frr frrvty
|
create 640 frr frrvty
|
||||||
|
|
||||||
postrotate
|
postrotate
|
||||||
for i in zebra bgpd ripd ospfd ripngd ospf6d isisd pimd; do
|
pid=$(lsof -t -a -c /syslog/ /var/log/frr/* 2>/dev/null)
|
||||||
if [ -e /var/run/frr/$i.pid ] ; then
|
if [ -n "$pid" ]
|
||||||
kill -USR1 `cat /var/run/frr/$i.pid`
|
then # using syslog
|
||||||
fi
|
kill -HUP $pid
|
||||||
|
fi
|
||||||
done
|
# 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 ; do
|
||||||
|
if [ -e /var/run/frr/$i.pid ] ; then
|
||||||
|
pids="$pids $(cat /var/run/frr/$i.pid)"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
[ -n "$pids" ] && kill -USR1 $pids
|
||||||
endscript
|
endscript
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
/var/log/frr/frr.log {
|
||||||
|
notifempty
|
||||||
|
missingok
|
||||||
|
postrotate
|
||||||
|
/bin/kill -HUP `cat /var/run/*syslog*.pid 2> /dev/null` 2> /dev/null || true
|
||||||
|
endscript
|
||||||
|
}
|
||||||
|
|
||||||
/var/log/frr/zebra.log {
|
/var/log/frr/zebra.log {
|
||||||
notifempty
|
notifempty
|
||||||
missingok
|
missingok
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
log file /var/log/frr/frr.log
|
# default to using syslog. /etc/rsyslog.d/45-frr.conf places the log
|
||||||
log timestamp precision 6
|
# in /var/log/frr/frr.log
|
||||||
|
log syslog informational
|
||||||
|
36
tools/etc/rsyslog.d/45-frr.conf
Normal file
36
tools/etc/rsyslog.d/45-frr.conf
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
# The lines below cause all FRR daemons and process to go
|
||||||
|
# to /var/log/frr/frr.log, then drops the message so it does
|
||||||
|
# not also go to /var/log/syslog, so the messages are not duplicated
|
||||||
|
|
||||||
|
$outchannel frr_log,/var/log/frr/frr.log
|
||||||
|
if $programname == 'babeld' or
|
||||||
|
$programname == 'bgpd' or
|
||||||
|
$programname == 'eigrpd' or
|
||||||
|
$programname == 'frr' or
|
||||||
|
$programname == 'isisd' or
|
||||||
|
$programname == 'ldpd' or
|
||||||
|
$programname == 'nhrpd' or
|
||||||
|
$programname == 'ospf6d' or
|
||||||
|
$programname == 'ospfd' or
|
||||||
|
$programname == 'pimd' or
|
||||||
|
$programname == 'ripd' or
|
||||||
|
$programname == 'ripngd' or
|
||||||
|
$programname == 'watchfrr' or
|
||||||
|
$programname == 'zebra'
|
||||||
|
then :omfile:$frr_log
|
||||||
|
|
||||||
|
if $programname == 'babeld' or
|
||||||
|
$programname == 'bgpd' or
|
||||||
|
$programname == 'eigrpd' or
|
||||||
|
$programname == 'frr' or
|
||||||
|
$programname == 'isisd' or
|
||||||
|
$programname == 'ldpd' or
|
||||||
|
$programname == 'nhrpd' or
|
||||||
|
$programname == 'ospf6d' or
|
||||||
|
$programname == 'ospfd' or
|
||||||
|
$programname == 'pimd' or
|
||||||
|
$programname == 'ripd' or
|
||||||
|
$programname == 'ripngd' or
|
||||||
|
$programname == 'watchfrr' or
|
||||||
|
$programname == 'zebra'
|
||||||
|
then stop
|
Loading…
Reference in New Issue
Block a user