Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Aug 2004 11:58:16 +0200
From:      Ruben de Groot <mail25@bzerk.org>
To:        Joshua Tinnin <krinklyfig@spymac.com>
Cc:        FreeBSD-questions <freebsd-questions@freebsd.org>
Subject:   Re: Restarting swatch when log turns over?
Message-ID:  <20040804095816.GA40948@ei.bzerk.org>
In-Reply-To: <200408032116.17573.krinklyfig@spymac.com>
References:  <200408032116.17573.krinklyfig@spymac.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Aug 03, 2004 at 09:16:17PM -0700, Joshua Tinnin typed:
> I hope this isn't too OT ...
> 
> How would I restart swatch when a log turns over? As of now, when a log turns 
> over, swatch continues running but doesn't read the new log. I thought maybe 
> I could use 
> 
> watchfor  /newsyslog/
>         exec killall -HUP swatch
> 
> in .swatchrc to match the newsyslog string, but when I try the command there 
> is no process matching swatch (it's running), and I don't know how to 
> reference the PID in such a situation (and use kill -HUP instead). Or does 
> swatch need to be restarted in this situation? Or maybe should newsyslog be 
> told to restart swatch (not sure how to do this)? I've read through the man 
> pages and searched the mailing list archives, and am not turning up 
> anything ...

You can specify these in newsyslog.conf, see newsyslog(8) :

     path_to_pid_file
             This optional field specifies the file name to read to find the
             daemon process id, or to find a process group id if the U flag
             was specified.  If this field is present, a signal_number is sent
             the process id contained in this file.  If this field is not
             present, then a SIGHUP signal will be sent to syslogd(8), unless
             the N flag has been specified.  This field must start with "/" in
             order to be recognized properly.

     signal_number
             This optional field specifies the signal number that will be sent
             to the daemon process (or to all processes in a process group, if
             the U flag was specified).  If this field is not present, then a
             SIGHUP signal will be sent.

gr, Ruben



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040804095816.GA40948>