Restarting swatch when log turns over?

Ruben de Groot mail25 at
Wed Aug 4 02:56:28 PDT 2004

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) :

             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.

             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

More information about the freebsd-questions mailing list