You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@vcl.apache.org by Clifton B Wood <Cl...@MORGAN.EDU> on 2010/07/21 21:46:53 UTC

VCL.log and Logrotate

I've tried getting this to work with no luck. It seems that 
VCL never closes the log file and there doesn't look to be any 
way to do so without restarting VCL. The big question then is: 
when is it safe to restart VCLd?

Most programs use SIGHUP to reread-config files, and also 
reset log files. VCLd does not do this, since HUNTSMAN() is 
linked to $SIG{HUP} and that effectively ends VCLd. 

What would be a good way to reset the log files in both VCLd 
and any forked children?

If I can come up with a way to do this, would the VCL project 
be interested in a patch?

- Cliff

RE: VCL.log and Logrotate

Posted by "Waldron, Michael H" <mw...@email.unc.edu>.
Cliff

You can rotate the vcld log without having to restart the daemon. Here is the entry I have in my /etc/logrotate.conf file:

/var/log/vcld.log {
    size 200M
    rotate 6
    copytruncate
}

The copytruncate directive truncates the original log file in place after creating a copy, so the daemon does not have to be restarted. It has worked well for me.

Mike Waldron
Systems Specialist
ITS Research Computing
University of North Carolina at Chapel Hill
CB #3420, ITS Manning, Rm 2509
919-962-9778


-----Original Message-----
From: Clifton B Wood [mailto:Clifton.Wood@MORGAN.EDU] 
Sent: Wednesday, July 21, 2010 3:47 PM
To: vcl-dev@incubator.apache.org
Subject: VCL.log and Logrotate

I've tried getting this to work with no luck. It seems that 
VCL never closes the log file and there doesn't look to be any 
way to do so without restarting VCL. The big question then is: 
when is it safe to restart VCLd?

Most programs use SIGHUP to reread-config files, and also 
reset log files. VCLd does not do this, since HUNTSMAN() is 
linked to $SIG{HUP} and that effectively ends VCLd. 

What would be a good way to reset the log files in both VCLd 
and any forked children?

If I can come up with a way to do this, would the VCL project 
be interested in a patch?

- Cliff

Re: VCL.log and Logrotate

Posted by Aaron Peeler <aa...@ncsu.edu>.
  vcld can be restarted anytime, the forked processes will continue to

I have this in most of our management nodes:

/var/log/vcld.log {
      rotate 5
      weekly
      minsize 5M
      postrotate
         /etc/init.d/vcld restart
      endscript
}

Aaron

On 7/21/10 3:46 PM, Clifton B Wood wrote:
> I've tried getting this to work with no luck. It seems that
> VCL never closes the log file and there doesn't look to be any
> way to do so without restarting VCL. The big question then is:
> when is it safe to restart VCLd?
>
> Most programs use SIGHUP to reread-config files, and also
> reset log files. VCLd does not do this, since HUNTSMAN() is
> linked to $SIG{HUP} and that effectively ends VCLd.
>
> What would be a good way to reset the log files in both VCLd
> and any forked children?
>
> If I can come up with a way to do this, would the VCL project
> be interested in a patch?
>
> - Cliff


-- 

Aaron Peeler
Program Manager
Virtual Computing Lab
NC State University
aaron_peeler@ncsu.edu
919-513-4571