Bug 225452 - syslogd.conf include functionality is broken
Summary: syslogd.conf include functionality is broken
Status: Closed DUPLICATE of bug 220884
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 11.1-RELEASE
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2018-01-25 15:36 UTC by Mark Felder
Modified: 2018-05-18 15:46 UTC (History)
7 users (show)

See Also:


Attachments
patch for 11-STABLE (630 bytes, patch)
2018-01-25 15:36 UTC, Mark Felder
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Felder freebsd_committer freebsd_triage 2018-01-25 15:36:05 UTC
Created attachment 190058 [details]
patch for 11-STABLE

this affects 11.1-RELEASE and 11-STABLE.

The config syntax is as follows:

include                                         /etc/syslog.d
include                                         /usr/local/etc/syslog.d


Unfortunately due to a bug in the code only one "include" line can be used and any lines after an "include" statement negates all of the configuration that was pulled in by that "include".

romain@ confirmed this bug and has this patch which applies to 11-STABLE, but this bug seems to be gone in CURRENT. There have been a lot of syslogd.c changes in CURRENT so it's hard to identify which commit may have inadvertently fixed it.

It would be appreciated if this could be fixed in an ERRATA
Comment 1 Mark Felder freebsd_committer freebsd_triage 2018-01-25 15:36:44 UTC
adding Romain and Bapt who can hopefully help sort this out officially
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2018-01-26 04:42:03 UTC
Add re@ for errata request
Comment 3 Delta Regeer 2018-05-17 21:12:32 UTC
This just bit me hard...

Only the last file included is actually processed/used, so when I set up:

/etc/syslog.d/dhcpd.conf
/etc/syslog.d/dhcp6c.conf
/etc/syslog.d/unbound.conf

only

unbound.conf was actually included/loaded:

Here is the debug output:

Trying to include files in '/etc/syslog.d'
reading /etc/syslog.d/local.conf
cfline("*.*	/var/log/dhcpd", f, "dhcpd", "*")
cfline("*.*	/var/log/unbound", f, "unbound", "*")
cfline("*.*	/var/log/dhcp6c", f, "dhcp6c", "*")
reading /etc/syslog.d/zzz.conf
cfline("*.*	/var/log/thisisatest", f, "someproc", "*")
Trying to include files in '/usr/local/etc/syslog.d'
Unable to open '/usr/local/etc/syslog.d': No such file or directory
4 3 2 3 5 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 X CONSOLE: /dev/console
7 5 2 5 5 5 6 3 5 5 X 5 5 5 5 5 5 5 5 5 5 5 5 5 X FILE: /var/log/messages
X X X X X X X X X X X X X 7 X X X X X X X X X X X FILE: /var/log/security
X X X X 6 X X X X X 6 X X X X X X X X X X X X X X FILE: /var/log/auth.log
X X 6 X X X X X X X X X X X X X X X X X X X X X X FILE: /var/log/maillog
X X X X X X 6 X X X X X X X X X X X X X X X X X X FILE: /var/log/lpd-errs
X X X X X X X X X X X 6 X X X X X X X X X X X X X FILE: /var/log/xferlog
X X X X X X X X X 7 X X X X X X X X X X X X X X X FILE: /var/log/cron
7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 X FILE: /var/log/debug.log (-devd)
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 X WALL:  (-devd)
7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 X FILE: /var/log/all.log (-devd)
7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 X FILE: /var/log/ppp.log (ppp)
7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 X FILE: /var/log/thisisatest (someproc)


Shows that zzz.conf with contents:

!*

!someproc
*.*	/var/log/thisisatest

Completely overrides local.conf which contains:

!dhcpd
*.*	/var/log/dhcpd

!unbound
*.*	/var/log/unbound

!dhcp6c
*.*	/var/log/dhcp6c

It would be great if this could get fixed before 11.2-RELEASE is cut.

Thanks,
Bert JW Regeer
Comment 4 Mark Johnston freebsd_committer freebsd_triage 2018-05-18 15:43:43 UTC
(In reply to Mark Felder from comment #0)
It looks like this patch was applied in r327348, so the issue will indeed be fixed in 11.2 and there's nothing to do at this point.
Comment 5 Mark Johnston freebsd_committer freebsd_triage 2018-05-18 15:46:21 UTC

*** This bug has been marked as a duplicate of bug 220884 ***