Logrotating and running a command

Brian A. Seklecki bseklecki at collaborativefusion.com
Mon Mar 19 12:44:34 UTC 2007


Sounds slightly beyond the mandate of newsyslog(8).   Although instead
of a path-to-PID, a glob to pass to pkill(8) -HUP ${glob} would be on my
NFR list.

At that point, logrotate(8) may seem appealing (or a custom solution):

       postrotate/endscript
              The  lines  between postrotate and endscript (both of which must
              appear on lines by themselves) are executed after the  log  file
              is  rotated.  These  directives  may only appear inside of a log
              file definition.  See prerotate as well.

For all your non-posix-signal-honoring-daemons out there.

~BAS

On Fri, 2007-03-16 at 19:22 -0300, José Pablo Fernández wrote:
> Hello,
> I need to rotate some logs, but instead of getting the PID out of a file and 
> sending a SIGHUP to that process, like newsyslog does, I need to run a 
> command.
> Is that possible with newsyslog? how should I do it?
> Thank you.
-- 
Brian A. Seklecki <bseklecki at collaborativefusion.com>
Collaborative Fusion, Inc.




IMPORTANT: This message contains confidential information and is intended only for the individual named. If the reader of this message is not an intended recipient (or the individual responsible for the delivery of this message to an intended recipient), please be advised that any re-use, dissemination, distribution or copying of this message is prohibited.  Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system.




More information about the freebsd-questions mailing list