Date: Sun, 18 Aug 2002 13:29:43 +0100 From: Matthew Seaman <m.seaman@infracaninophile.co.uk> To: sroberts@dsl.pipex.com Cc: Matthew Seaman <m.seaman@infracaninophile.co.uk>, FreeBSD Questions <freebsd-questions@FreeBSD.ORG> Subject: Re: How to add service to log in newsyslog.conf? Message-ID: <20020818122943.GE2079@happy-idiot-talk.infracaninophi> In-Reply-To: <1029669916.5163.5.camel@Demon.vickiandstacey.com> References: <1029631750.38776.229.camel@Demon.vickiandstacey.com> <20020818110909.GC2079@happy-idiot-talk.infracaninophi> <1029669916.5163.5.camel@Demon.vickiandstacey.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020818122943.GE2079>