From owner-freebsd-doc Thu Sep 6 5:30:23 2001 Delivered-To: freebsd-doc@freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id CBF6E37B403 for ; Thu, 6 Sep 2001 05:30:03 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f86CU3G75810; Thu, 6 Sep 2001 05:30:03 -0700 (PDT) (envelope-from gnats) Date: Thu, 6 Sep 2001 05:30:03 -0700 (PDT) Message-Id: <200109061230.f86CU3G75810@freefall.freebsd.org> To: freebsd-doc@freebsd.org Cc: From: Ruslan Ermilov Subject: Re: docs/30374: logger(1) manpage has wrong with default value of -p option Reply-To: Ruslan Ermilov Sender: owner-freebsd-doc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR docs/30374; it has been noted by GNATS. From: Ruslan Ermilov To: "SUGIMURA Takashi ?$B?yB 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 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