Handle the logfiles in newsyslog and syslogd conditionally, based on

src.conf(5) knobs

This will allow consumers of FreeBSD to use the unmodified configuration
files out of the box more than previously.

Both newsyslog.conf and syslog.conf:
- /var/log/lpd-errs (MK_LPR != no)
- /var/log/ppp.log (MK_PPP != no)
- /var/log/xferlog (MK_FTP != no)

newsyslog.conf:
- /var/log/amd.log (MK_AMD != no)
- /var/log/pflog (MK_PF != no)
- /var/log/sendmail.st (MK_SENDMAIL != no)

MFC after:      3 weeks
Sponsored by:   Dell EMC Isilon
This commit is contained in:
Enji Cooper 2017-05-13 03:10:50 +00:00
parent d74da94ce4
commit e5c4c8aa7f
15 changed files with 73 additions and 11 deletions

View File

@ -8,7 +8,8 @@ FILESGROUPS= FILES
# No need as it is empty and just causes rebuilds since this file does so much.
UPDATE_DEPENDFILE= no
SUBDIR= \
newsyslog.conf.d
newsyslog.conf.d \
syslog.d
.if ${MK_SENDMAIL} != "no"
SUBDIR+=sendmail

View File

@ -18,7 +18,6 @@
#
# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num]
/var/log/all.log 600 7 * @T00 J
/var/log/amd.log 644 7 1000 * J
/var/log/auth.log 600 7 1000 @0101T JC
/var/log/console.log 600 5 1000 * J
/var/log/cron 600 3 1000 * JC
@ -26,18 +25,13 @@
/var/log/debug.log 600 7 1000 * JC
/var/log/init.log 644 3 1000 * J
/var/log/kerberos.log 600 7 1000 * J
/var/log/lpd-errs 644 7 1000 * JC
/var/log/maillog 640 7 * @T00 JC
/var/log/messages 644 5 1000 @0101T JC
/var/log/monthly.log 640 12 * $M1D0 JN
/var/log/pflog 600 3 1000 * JB /var/run/pflogd.pid
/var/log/ppp.log root:network 640 3 1000 * JC
/var/log/devd.log 644 3 1000 * JC
/var/log/security 600 10 1000 * JC
/var/log/sendmail.st 640 10 * 168 BN
/var/log/utx.log 644 3 * @01T05 B
/var/log/weekly.log 640 5 * $W6D0 JN
/var/log/xferlog 600 7 1000 * JC
<include> /etc/newsyslog.conf.d/*
<include> /usr/local/etc/newsyslog.conf.d/*

View File

@ -6,8 +6,32 @@ BINDIR= /etc/newsyslog.conf.d
FILES=
.if ${MK_AMD} != "no"
FILES+= amd.conf
.endif
.if ${MK_FTP} != "no"
FILES+= ftp.conf
.endif
.if ${MK_LPR} != "no"
FILES+= lpr.conf
.endif
.if ${MK_OFED} != "no"
FILES+= opensm.conf
.endif
.if ${MK_PF} != "no"
FILES+= pf.conf
.endif
.if ${MK_PPP} != "no"
FILES+= ppp.conf
.endif
.if ${MK_SENDMAIL} != "no"
FILES+= sendmail.conf
.endif
.include <bsd.prog.mk>

View File

@ -0,0 +1,2 @@
# $FreeBSD$
/var/log/amd.log 644 7 1000 * J

View File

@ -0,0 +1,2 @@
# $FreeBSD$
/var/log/xferlog 600 7 1000 * JC

View File

@ -0,0 +1,2 @@
# $FreeBSD$
/var/log/lpd-errs 644 7 1000 * JC

View File

@ -0,0 +1,2 @@
# $FreeBSD$
/var/log/pflog 600 3 1000 * JB /var/run/pflogd.pid

View File

@ -0,0 +1,2 @@
# $FreeBSD$
/var/log/ppp.log root:network 640 3 1000 * JC

View File

@ -0,0 +1,2 @@
# $FreeBSD$
/var/log/sendmail.st 640 10 * 168 BN

View File

@ -10,8 +10,6 @@
security.* /var/log/security
auth.info;authpriv.info /var/log/auth.log
mail.info /var/log/maillog
lpr.info /var/log/lpd-errs
ftp.info /var/log/xferlog
cron.* /var/log/cron
!-devd
*.=debug /var/log/debug.log
@ -31,8 +29,6 @@ cron.* /var/log/cron
# Uncomment this if you wish to see messages produced by devd
# !devd
# *.>=notice /var/log/devd.log
!ppp
*.* /var/log/ppp.log
!*
include /etc/syslog.d
include /usr/local/etc/syslog.d

19
etc/syslog.d/Makefile Normal file
View File

@ -0,0 +1,19 @@
# $FreeBSD$
.include <src.opts.mk>
.if ${MK_FTP} != "no"
FILES+= ftp.conf
.endif
.if ${MK_LPR} != "no"
FILES+= lpr.conf
.endif
.if ${MK_PPP} != "no"
FILES+= ppp.conf
.endif
BINDIR= /etc/syslog.d
.include <bsd.prog.mk>

2
etc/syslog.d/ftp.conf Normal file
View File

@ -0,0 +1,2 @@
# $FreeBSD$
ftp.info /var/log/xferlog

2
etc/syslog.d/lpr.conf Normal file
View File

@ -0,0 +1,2 @@
# $FreeBSD$
lpr.info /var/log/lpd-errs

3
etc/syslog.d/ppp.conf Normal file
View File

@ -0,0 +1,3 @@
# $FreeBSD$
!ppp
*.* /var/log/ppp.log

View File

@ -56,6 +56,7 @@ OLD_FILES+=usr/share/man/man8/iasl.8.gz
.if ${MK_AMD} == no
OLD_FILES+=etc/amd.map
OLD_FILES+=etc/newsyslog.conf.d/amd.conf
OLD_FILES+=etc/rc.d/amd
OLD_FILES+=usr/bin/pawd
OLD_FILES+=usr/sbin/amd
@ -1588,9 +1589,11 @@ OLD_FILES+=usr/share/man/man8/fmtree.8.gz
.if ${MK_FTP} == no
OLD_FILES+=etc/ftpusers
OLD_FILES+=etc/newsyslog.conf.d/ftp.conf
OLD_FILES+=etc/pam.d/ftp
OLD_FILES+=etc/pam.d/ftpd
OLD_FILES+=etc/rc.d/ftpd
OLD_FILES+=etc/syslog.d/ftp.conf
OLD_FILES+=usr/bin/ftp
OLD_FILES+=usr/bin/gate-ftp
OLD_FILES+=usr/bin/pftp
@ -6183,7 +6186,9 @@ OLD_FILES+=usr/share/man/man8/updatedb.8.gz
.if ${MK_LPR} == no
OLD_FILES+=etc/hosts.lpd
OLD_FILES+=etc/printcap
OLD_FILES+=etc/newsyslog.conf.d/lpr.conf
OLD_FILES+=etc/rc.d/lpd
OLD_FILES+=etc/syslog.d/lpr.conf
OLD_FILES+=usr/bin/lp
OLD_FILES+=usr/bin/lpq
OLD_FILES+=usr/bin/lpr
@ -7158,6 +7163,7 @@ OLD_DIRS+=usr/share/examples/pc-sysinstall
.endif
.if ${MK_PF} == no
OLD_FILES+=etc/newsyslog.conf.d/pf.conf
OLD_FILES+=etc/periodic/security/520.pfdenied
OLD_FILES+=etc/pf.os
OLD_FILES+=etc/rc.d/ftp-proxy
@ -7297,7 +7303,9 @@ OLD_FILES+=usr/share/man/man8/portsnap.8.gz
.endif
.if ${MK_PPP} == no
OLD_FILES+=etc/newsyslog.conf.d/ppp.conf
OLD_FILES+=etc/ppp/ppp.conf
OLD_FILES+=etc/syslog.d/ppp.conf
OLD_DIRS+=etc/ppp
OLD_FILES+=usr/sbin/ppp
OLD_FILES+=usr/sbin/pppctl
@ -7473,6 +7481,7 @@ OLD_FILES+=usr/share/man/man8/rtquery.8.gz
.endif
.if ${MK_SENDMAIL} == no
OLD_FILES+=etc/newsyslog.conf.d/sendmail.conf
OLD_FILES+=etc/periodic/daily/150.clean-hoststat
OLD_FILES+=etc/periodic/daily/440.status-mailq
OLD_FILES+=etc/periodic/daily/460.status-mail-rejects