Bug 221742 - syslogd include directive reads but disregards all but the last included .conf file
Summary: syslogd include directive reads but disregards all but the last included .con...
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 Some People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-23 15:23 UTC by Mark.Martinec
Modified: 2017-09-09 13:42 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark.Martinec 2017-08-23 15:23:54 UTC
The 11.1 release brought a very desirable feature to syslogd:

$ man syslog.conf :
  A special include keyword can be used to include all files with names
  ending in '.conf' and not beginning with a '.' contained in the directory
  following the keyword.

but ...

It turns out that of all the *.conf files found in the included
directory /etc/syslog.d, only entries found in the (alphabetically)
*last* file there are taken into account, all other entries in
remaining included files are just ignored.

What is interesting is that all log files listed in all included
conf files are indeed created at the syslogd start time, it's just
that they never receive any log messages.

Running syslogd with a -d (debug) option confirms this: all included
files are indeed read, but the reported matrix only reflects
log entries from the main syslog.conf file and from the last of the
included files:


  $ cat /etc/syslog.conf
  include         /etc/syslog.d

  $ ls -l /etc/syslog.d
  -rw-r--r--  1 root  wheel  28 Aug 23 17:15 aaa.conf
  -rw-r--r--  1 root  wheel  32 Aug 23 17:15 ddd.conf
  -rw-r--r--  1 root  wheel  28 Aug 23 17:15 mmm.conf

  $ cat /etc/syslog.d/aaa.conf
  auth.info       /var/log/auth.log

  $ cat /etc/syslog.d/ddd.conf
  daemon.info     /var/log/daemon.log

  $ cat /etc/syslog.d/mmm.conf
  mail.info       /var/log/mail.log

  # syslogd -d -F
  socksetup: new socket fd is 6
  socksetup: new socket fd is 7
  listening on inet and/or inet6 socket
  sending on inet and/or inet6 socket
  off & running....
  init
  loading timezone data via tzset()
  Trying to include files in '/etc/syslog.d'
  reading /etc/syslog.d/aaa.conf
  cfline("auth.info       /var/log/auth.log", f, "*", "*")
  reading /etc/syslog.d/ddd.conf
  cfline("daemon.info     /var/log/daemon.log", f, "*", "*")
  reading /etc/syslog.d/mmm.conf
  cfline("mail.info       /var/log/mail.log", f, "*", "*")
  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/mail.log
  logmsg: pri 56, flags 4, from sleepy, msg syslogd: restart
  syslogd: restarted
  logmsg: pri 6, flags 4, from sleepy, msg syslogd: kernel boot file is /boot/kernel/kernel
  syslogd: kernel boot file is /boot/kernel/kernel
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2017-08-24 12:43:25 UTC
sobomax@, was it you that was working on the upgraded functionality?  I have lost track, sorry.
Comment 2 Mark.Martinec 2017-08-25 09:46:21 UTC
releng/11.1 SVN log shows the following:



------------------------------------------------------------------------
r308721 | bapt | 2016-11-16 08:04:49 +0100 (Wed, 16 Nov 2016) | 20 lines

MFC r308160:

syslogd(8): add an 'include' keyword

All the '.conf' files not beginning with a '.' contained int he directory
following the keyword will be included.

This keyword can only be used in the first level configuration files.

Modify the default syslogd.conf to 'include' /etc/syslog.d and
/usr/local/etc/syslog.d

It simplify a lot handling of syslog from automation tools.

Reviewed by:    markj, kib (via irc)
Approved by:    markj
MFC after:      2 weeks
Relnotes:       yes
Differential Revision:  https://reviews.freebsd.org/D8402
Comment 3 Yasuhiro Kimura freebsd_committer freebsd_triage 2017-09-09 05:06:50 UTC
The issue is already reported in bug #220884 and patch is submitted to it.
So this PR should be closed with the reason of DUPLICATE.
Comment 4 Ed Maste freebsd_committer freebsd_triage 2017-09-09 13:42:41 UTC

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