Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Sep 2001 05:20:02 -0700 (PDT)
From:      Ruslan Ermilov <ru@freebsd.org>
To:        freebsd-doc@freebsd.org
Subject:   Re: docs/30374: logger(1) manpage has wrong with default value of -p option
Message-ID:  <200109061220.f86CK2e68987@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR docs/30374; it has been noted by GNATS.

From: Ruslan Ermilov <ru@freebsd.org>
To: "SUGIMURA Takashi ?$B?yB<?(B ?$B5.;N?(B" <sugimura@YasudaKei.org>
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: docs/30374: logger(1) manpage has wrong with default value of -p option
Date: Thu, 6 Sep 2001 15:05:48 +0300

 On Thu, Sep 06, 2001 at 08:07:50PM +0900, SUGIMURA Takashi ?$B?yB<?(B ?$B5.;N?(B wrote:
 > Hello,
 > 
 > >> getting syslog packet, it has "<5>hogehoge" sequence.
 > >> 5 is 0x0000 plus 0x0101, so its facility is "kern"
 > >> and its priority is "notice".
 > >> 
 > >I see this: ``Sep  6 12:18:32 <1.5> perl ru: hogehoge''
 > >which means (1<<3) | 5 == LOG_USER | LOG_NOTICE.
 > >
 > 
 > No, I tried many other facility and priority, then I know that
 > (LOG_USER | LOG_NOTICE) is <13>.
 > 
 Err.  Is't impossible to generate a LOG_KERN using syslog(3).
 Only kernel can generate these.
 
 LOG_KERN | LOG_NOTICE == LOG_NOTICE, as LOG_KERN is defined as (0<<3).
 And libc/gen/syslog.c defaults facility to LOG_USER:
 
 : static int      LogFacility = LOG_USER; /* default facility code */
 [...]
 :         /* Set default facility if none specified. */
 :         if ((pri & LOG_FACMASK) == 0)
 :                 pri |= LogFacility;
 
 LOG_KERN is defined as follows:
 
 #define LOG_KERN        (0<<3)  /* kernel messages */
 #define LOG_USER        (1<<3)  /* random user-level messages */
 
 So if you call ``logger -p kern.notice'', that becomes as if it
 were ``logger -p user.notice''.  This is also documented in the
 syslog(3) manpage:
 
 : LOG_KERN      Messages generated by the kernel.  These cannot be
 :               generated by any user processes.
 [...]
 : LOG_USER      Messages generated by random user processes.  This
 :               is the default facility identifier if none is specified.
 
 
 Cheers,
 -- 
 Ruslan Ermilov		Oracle Developer/DBA,
 ru@sunbay.com		Sunbay Software AG,
 ru@FreeBSD.org		FreeBSD committer,
 +380.652.512.251	Simferopol, Ukraine
 
 http://www.FreeBSD.org	The Power To Serve
 http://www.oracle.com	Enabling The Information Age

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-doc" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200109061220.f86CK2e68987>