Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Sep 2001 05:30:03 -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:  <200109061230.f86CU3G75810@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:28:39 +0300

 On Thu, Sep 06, 2001 at 09:25:45PM +0900, SUGIMURA Takashi ?$B?yB<?(B ?$B5.;N?(B wrote:
 > I am very sad you've closed the PR.
 > 
 > >> 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.
 > >
 > 
 > I see, but this problem is not concern about syslog(3).
 > 
 > 
 > >LOG_KERN | LOG_NOTICE == LOG_NOTICE, as LOG_KERN is defined as (0<<3).
 > 
 > Yes, I know, of course.
 > LOG_NOTICE is decoded to <5>, so LOG_KERN | LOG_NOTICE is <5>, not <13>.
 > 13 = (1<<3) | 5.
 > 
 > 
 > >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:
 > >
 > 
 > Is it right?
 > 
 > I say that about logger(1).
 > Please see main() on /usr/src/usr.bin/logger/logger.c:
 > 
 > ----------------
 > int
 > main(argc, argv)
 >         int argc;
 >         char *argv[];
 > {
 >         int ch, logflags, pri;
 >         char *tag, *host, buf[1024];
 > 
 >         tag = NULL;
 >         host = NULL;
 >         pri = LOG_NOTICE;
 >         logflags = 0;
 >         unsetenv("TZ");
 >         while ((ch = getopt(argc, argv, "46Af:h:ip:st:")) != -1)
 > (snip)
 > ----------------
 > 
 > This shows the default value of variable "pri" is "LOG_NOTICE",
 > it is not (LOG_USER | LOG_NOTICE) as you said.
 > 
 > And, logger(1) don't use syslog(3) functions, simply send a UDP packet
 > to the port 514.
 > 
 Are you sure?
 
 :         if (host == NULL) {
 :                 syslog(pri, "%s", buf);
 :                 return;
 :         }
 
 
 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?200109061230.f86CU3G75810>