From owner-freebsd-questions@FreeBSD.ORG Wed Jul 11 13:24:53 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2076C16A421 for ; Wed, 11 Jul 2007 13:24:53 +0000 (UTC) (envelope-from info@plot.uz) Received: from ik-out-1112.google.com (ik-out-1112.google.com [66.249.90.176]) by mx1.freebsd.org (Postfix) with ESMTP id 85A5913C4C4 for ; Wed, 11 Jul 2007 13:24:52 +0000 (UTC) (envelope-from info@plot.uz) Received: by ik-out-1112.google.com with SMTP id c21so1272271ika for ; Wed, 11 Jul 2007 06:24:51 -0700 (PDT) Received: by 10.78.170.6 with SMTP id s6mr2408243hue.1184160290801; Wed, 11 Jul 2007 06:24:50 -0700 (PDT) Received: from plot.uz ( [83.221.168.151]) by mx.google.com with ESMTP id i7sm632586nfh.2007.07.11.06.24.25 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 11 Jul 2007 06:24:50 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=INFO_TLD autolearn=no version=3.1.7 X-Spam-Report: * 0.8 INFO_TLD URI: Contains an URL in the INFO top-level domain Received: from localhost by plot.uz (MDaemon PRO v9.5.5) with DomainPOP id md50000003655.msg for ; Wed, 11 Jul 2007 18:26:22 +0500 Delivered-To: aleksey@plot.uz Received: by 10.100.154.8 with SMTP id b8cs23216ane; Wed, 11 Jul 2007 06:18:41 -0700 (PDT) Received: by 10.114.197.1 with SMTP id u1mr5127552waf.1184159823911; Wed, 11 Jul 2007 06:17:03 -0700 (PDT) Received: from mx2.freebsd.org (mx2.freebsd.org [69.147.83.53]) by mx.google.com with ESMTP id k9si33220293wah.2007.07.11.06.17.02; Wed, 11 Jul 2007 06:17:03 -0700 (PDT) Received-SPF: pass (google.com: domain of owner-freebsd-isp@freebsd.org designates 69.147.83.53 as permitted sender) DomainKey-Status: bad (test mode) Received: from hub.freebsd.org (hub.freebsd.org [69.147.83.54]) by mx2.freebsd.org (Postfix) with ESMTP id 6C089C356; Wed, 11 Jul 2007 13:14:57 +0000 (UTC) (envelope-from owner-freebsd-isp@freebsd.org) Received: from hub.freebsd.org (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id 64EF116A47E; Wed, 11 Jul 2007 13:14:57 +0000 (UTC) (envelope-from owner-freebsd-isp@freebsd.org) X-Original-To: freebsd-isp@freebsd.org Delivered-To: freebsd-isp@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8328A16A400 for ; Wed, 11 Jul 2007 13:14:52 +0000 (UTC) (envelope-from patrick_dkt@yahoo.com.hk) Received: from web54305.mail.re2.yahoo.com (web54305.mail.re2.yahoo.com [206.190.49.115]) by mx1.freebsd.org (Postfix) with SMTP id 477C913C4C4 for ; Wed, 11 Jul 2007 13:14:52 +0000 (UTC) (envelope-from patrick_dkt@yahoo.com.hk) Received: (qmail 71873 invoked by uid 60001); 11 Jul 2007 13:14:48 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com.hk; h=X-YMail-OSG:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=i4N6vvlN5fIrQisP4MQz8IL91Hljv1l5R0/HWJfJixf/xUHL86VoENc46YdoDRQ/RyI9MK1mLxywO/kDKhpYH1BXD3OHSoXWrB0KMvoUf9mUkdHbxVJpZdNuRZS7TrN0UzuhnPULpnRF6PyL36a0Tt+dgWHjFO9kHZH8VRHteYo=; X-YMail-OSG: xKHeDLUVM1kvaWEwSaKUHSU7p9H8IMMX.z4JrTeRbeULmZwNglMKhoKH7l4EtIgyn5Z.RUvINyrUezOtflhjMFMeNCdnGS4qnxrf3tutg987mTw- Received: from [61.15.61.52] by web54305.mail.re2.yahoo.com via HTTP; Wed, 11 Jul 2007 06:14:47 PDT Date: Wed, 11 Jul 2007 06:14:47 -0700 (PDT) To: Doug Barton , freebsd-isp@freebsd.org, freebsd-questions@freebsd.org In-Reply-To: <46947AB8.809@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <989377.60550.qm@web54305.mail.re2.yahoo.com> X-BeenThere: freebsd-isp@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Errors-To: owner-freebsd-isp@freebsd.org X-Return-Path: owner-freebsd-isp@freebsd.org X-Envelope-From: owner-freebsd-isp@freebsd.org X-MDaemon-Deliver-To: freebsd-questions@freebsd.org X-Spam-Processed: plot.uz, Wed, 11 Jul 2007 18:26:24 +0500 From: Patrick Dung Cc: Patrick Dung Subject: Re: FreeBSD 6.2 default bind9, question about customize logging [re-post] (solved) X-BeenThere: freebsd-questions@freebsd.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jul 2007 13:24:53 -0000 --- Doug Barton wrote: > > On Sunday, 8 July 2007 at 12:06:26 -0700, Patrick Dung wrote: > >> I am using FreeBSD 6.2 with the default bind (not ports). > >> By default chroot is used. > > It's not a major issue, but it's probably worth pointing out that > whatever code base you use (base or ports) the behavior such as > chroot, logging, etc. is controlled by the combination of > /etc/rc.d/named and your named.conf options. Therefore this > discussion > applies equally well either way. I use FreeBSD 6.2 with the named come with the base. /etc/rc.conf named_enable="YES" # Run named, the DNS server (or NO). named_program="/usr/sbin/named" # path to named, if you want a different one. #named_flags="" # Flags for named named_pidfile="/var/run/named/pid" # Must set this in named.conf as well named_uid="bind" # User to run named as named_chrootdir="/var/named" # Chroot directory (or "" not to auto-chroot it) named_chroot_autoupdate="YES" # Automatically install/update chrooted # components of named. See /etc/rc.d/named. named_symlink_enable="YES" # Symlink the chrooted pid file > > >> When named start or stop, it does have log in /var/log/messages. > >> But for example, when some do domain transfer successfully, that > is not > >> logged (zone transfer denied is logged). > > I have intentionally avoided adding more complex logging to the > default named.conf because it's very hard to decide which way to land > on this to make the most people happy (and/or the least people mad). > I > am of course always open to suggestions. :) I need to log successful domain transfer for debugging purpose (which slave/client has done domain transfer at what time). > > >> So I tried to add this part in named.conf (enabled local0.* in > >> syslog.conf) , but still no luck. Any suggestions? > > The obvious ones, did you HUP the daemon after you changed the conf, > and did you pre-create any new files that syslogd is supposed to > write > to for the local0 facility? Can you share your syslog.conf line for > this? Do you get any joy when you try 'logger -plocal0.info blah' ? > > >> logging { > >> channel named-log { > > While I don't see that it's explicitly forbidden to use a - in a > channel name, every example I've ever seen or used myself uses an > underscore instead (named_log). > > >> //syslog daemon; > >> syslog local0; > >> severity info; > >> print-category yes; > >> }; > >> category default { named-log; }; > >> category xfer-in { named-log; }; > >> category xfer-out { named-log; }; > >> category unmatched { null; }; > >> }; > > This all looks good (modulo the - issue I mentioned above), and I use > something similar myself, so once you're sure you can write to the > syslog facility, you should be able to get this to work. > > I should probably also point out that unless you really need this to > go to syslog, you're probably better off writing to a file channel > instead (less overhead, especially on a busy server). Either way > there > is information in the ARM that will help you, > /usr/share/doc/bind9/arm. > After furher testing, I got my problem solved. 1. I found named-log is ok to use. 2. I did not need to change my previous named.conf. 3. The problem is in /etc/syslog.conf With the default /etc/syslog.conf, I have add a line: local0.* /var/log/messages There is a difference on where I put it, if I put it at the bottom of the file, even `logger -p local0.info test` will not work. If it put that line on the top-most of syslog.conf, everything is working fine... BTW, could anyone explain why putting local0.* /var/log/messages at the bottom of syslog.conf will not work? Regards Patrick > > hth, > > Doug > > -- > > This .signature sanitized for your protection > ____________________________________________________________________________________ Looking for a deal? Find great prices on flights and hotels with Yahoo! FareChase. http://farechase.yahoo.com/ _______________________________________________ freebsd-isp@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-isp To unsubscribe, send any mail to "freebsd-isp-unsubscribe@freebsd.org"