From owner-freebsd-questions Sun Aug 18 5:29:59 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5CDE437B400 for ; Sun, 18 Aug 2002 05:29:54 -0700 (PDT) Received: from smtp.infracaninophile.co.uk (happy-idiot-talk.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5F8C043E65 for ; Sun, 18 Aug 2002 05:29:53 -0700 (PDT) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk ([IPv6:::1]) by smtp.infracaninophile.co.uk (8.12.5/8.12.5) with ESMTP id g7ICTnQI003028; Sun, 18 Aug 2002 13:29:49 +0100 (BST) (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost) by happy-idiot-talk.infracaninophile.co.uk (8.12.5/8.12.5/Submit) id g7ICThUD003027; Sun, 18 Aug 2002 13:29:43 +0100 (BST) Date: Sun, 18 Aug 2002 13:29:43 +0100 From: Matthew Seaman To: sroberts@dsl.pipex.com Cc: Matthew Seaman , FreeBSD Questions Subject: Re: How to add service to log in newsyslog.conf? Message-ID: <20020818122943.GE2079@happy-idiot-talk.infracaninophi> References: <1029631750.38776.229.camel@Demon.vickiandstacey.com> <20020818110909.GC2079@happy-idiot-talk.infracaninophi> <1029669916.5163.5.camel@Demon.vickiandstacey.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1029669916.5163.5.camel@Demon.vickiandstacey.com> User-Agent: Mutt/1.5.1i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sun, Aug 18, 2002 at 12:25:14PM +0100, Stacey Roberts wrote: > I wasn't sure about the PID column and how to use it, didn't mean to > waste anyone's time here. You only need to use the PID column for daemons that run persistently and log directly (ie. not via syslog(2)) to a file to which they keep an open file descriptor. The daemon also needs to be programmed so that it will re-open its log files on receipt of a signal --- usually SIGHUP, but not always. Sending a SIGHUP to syslogd(8) is handled automatically by newsyslog(1), so you don't need to add any extra configuration to support that. For instance, apache httpd fulfils those criteria, and I have: # Nb. signal 30 == SIGUSR1 => graceful restart of apache # /var/log/httpd-access.log 644 20 100 * Z /var/run/httpd.pid 30 You can see if a daemon has a log file open for writing by using the fstat(1) command: happy-idiot-talk:~:% fstat /var/log/messages USER CMD PID FD MOUNT INUM MODE SZ|DV R/W NAME root syslogd 92 8 /var 170 -rw-r--r-- 114 w /var/log/messages Since you're (presumably) running ftpd(8) out of inetd(8), which means that ftpd(8) doesn't run continually, you don't need to worry about signalling it to close and re-open its log files. The config you've set up will be fine. Cheers, Matthew -- Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way Tel: +44 1628 476614 Marlow Fax: +44 0870 0522645 Bucks., SL7 1TH UK To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message