NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/39136: syslogd confusion between output files and configuration lines

>Number:         39136
>Category:       bin
>Synopsis:       syslogd confusion between output files and configuration lines
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jul 12 08:05:00 +0000 2008
>Originator:     Alan Barrett
>Release:        NetBSD 4.99.69
Not much
System: NetBSD 4.99.69
Architecture: i386
Machine: i386
    If multiple lines in the syslog.conf fil refer to the same output
    fiel, syslogd does the wrong thing, such as sending the same
    output multiple times, or incorrectly accounting for the idle time.


    Configure /etc/syslog.conf as follows:
        # Next three lines come from NetBSD's default syslog.conf file
        *.err;kern.*;auth.notice;authpriv.none;mail.crit /dev/console
        *.info;auth,authpriv,cron,ftp,kern,lpr,mail.none /var/log/messages
        kern.debug                                       /var/log/messages
        # Next three lines send *.debug messages from the "logger" program
        # to /var/log/messages, supplementing the "*.err" above.
        *.debug                                          /var/log/messages
        # Next lines send "mark" messages to console and file.                                        /dev/console                                        /var/log/messages

    Observe that "mark" messages appear on /dev/console and in
    /var/log/messages every 20 minutes, despite the following code in

        /* don't output marks to recently written files */
        if ((flags & MARK) && (now - f->f_time) < MarkInterval / 2)

    Run the following commands:

        for level in debug err ; do
            logger -t logger -p user.${level} -t "test message ($level)"

    Observe that the message at level "err" appears twice in

    Each entry in syslogd's "struct filed *Files" data structure
    keeps information derived from a single line in the configuration
    file (such as rules about how to match a message against the
    configuration line), as well as information about the output file
    (such as the open file sescriptor, and the time of the most recent

    These two types of information shuold be separated into two data
    structures, with the ability for multiple lines in the configuration
    file to refer to a single output file.  Matching of messages against
    rules should use one data structure, while timeout handling and
    duplicate suppression uses the other data structure.

Home | Main Index | Thread Index | Old Index