NetBSD-Bugs archive

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

lib/43300: syslog(3): LOG_PID inconsistency



>Number:         43300
>Category:       lib
>Synopsis:       syslog(3): LOG_PID inconsistency
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lib-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu May 13 14:20:00 +0000 2010
>Originator:     Takahiro Kambe
>Release:        NetBSD 5.99.29
>Organization:
Takahiro Kambe
>Environment:
        
        
System: NetBSD edge.back-street.net 5.99.29 NetBSD 5.99.29 (VMWARE-F3-MONO) 
#11: Fri May 7 15:16:09 JST 2010 
taca%edge.back-street.net@localhost:/var/obj/sys/arch/i386/compile/VMWARE-F3-MONO
 i386
Architecture: i386
Machine: i386
>Description:
        syslog(3) was updated to support RFC5424 and syslog(3)'s behavior
        was changed when LOG_PERROR was specified.  And description about
        LOG_PID isn't match with current behavior.
        
>How-To-Repeat:
        Here is sample program.

#include <syslog.h>
#include <stdlib.h>

int
main(int argc, char **argv)
{
        openlog("test", LOG_PID | LOG_PERROR, LOG_DAEMON);
        syslog(LOG_DEBUG, "This is a test message.");
        exit(0);
}

        On NetBSD 5.1_RC1:

test[24604]: This is a test message.

        On NetBSD 5.99.29:

test 27496 - - This is a test message.

        I think latter refrects syslog message format of RFC5424. But at
        the same time, syslog(3) says

     LOG_PID       Log the process id with each message: useful for identify-
                   ing instantiations of daemons.  (This PID is placed within
                   brackets between the ident and the message.)

        It is correct for the effect of LOG_PID to a log file of syslogd(8)
        but not for output by LOG_PERROR.

>Fix:
        Fix documentation of syslog(3) or make syslog(3) to output as
        document.

test[27496] - - This is a test message.

        or

test[27496]: - - This is a test message.

>Unformatted:
        
        


Home | Main Index | Thread Index | Old Index