From owner-freebsd-doc Thu Sep 6 5:20: 8 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 158F137B405 for ; Thu, 6 Sep 2001 05:20:02 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f86CK2e68987; Thu, 6 Sep 2001 05:20:02 -0700 (PDT) (envelope-from gnats) Date: Thu, 6 Sep 2001 05:20:02 -0700 (PDT) Message-Id: <200109061220.f86CK2e68987@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:05:48 +0300 On Thu, Sep 06, 2001 at 08:07:50PM +0900, SUGIMURA Takashi ?$B?yB 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