<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Thank you for your replies Raymond and Nathan.<div><br></div><div>Can you possibly shed some light on the " /usr/sbin/invoke-rc.d" part?  Read on for more context...<br><br>I want to use logrotate to rotate the varnish log files.  I found the file (/home/username/varnish-1.1.1/debian/varnish.logrotate) containing the following:<br>>>><br>/var/log/varnish/varnish.log {<br> daily<br> rotate 7<br> compress<br> delaycompress<br> postrotate<br>   /usr/sbin/invoke-rc.d varnishlog reload > /dev/null<br> endscript<br>}<br>>>><br><br>However, we are using varnishncsa and not varnishlog. Running "ps aux | grep varnish" yields:<br>>><br>/opt/varnish/sbin/varnishd<br>/opt/varnish/bin/varnishncsa -a -c -w /var/log/varnish.log<br>>><br><br>Is setting up logrotate for varnishncsa as simple as changing the invoke-rc.d line of the logrotate file to be:<br>>><br>   /usr/sbin/invoke-rc.d varnishncsa reload > /dev/null<br>>><br><br>If so, how to pass in the ncsa commandline parameters?<br><br>Thanks for any guidance.<br>-Chris<br><div apple-content-edited="true"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(68, 66, 65); font-family: Arial; font-size: 17px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="color: rgb(68, 66, 65); font-family: Arial; font-weight: bold; "><div><div><div style="margin-top: 0in; margin-right: 0in; margin-left: 0in; margin-bottom: 0.0001pt; "><font class="Apple-style-span" face="Arial" size="5"><span class="Apple-style-span" style="font-size: 17px; "> </span></font></div><font class="Apple-style-span" face="Arial" size="5"></font></div></div></span></div></div></span></div><br><div><div>On Sep 5, 2008, at 10:39 AM, Nathan Kinkade wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>2008/9/4 Chris Johnson <<a href="mailto:cjohnson@socialvibe.com">cjohnson@socialvibe.com</a>>:<br><blockquote type="cite">Does anyone successfully have logrotate working with varnishncsa?<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Thanks,<br></blockquote><blockquote type="cite">Chrs<br></blockquote><br>Below is the solution I came up with.  The lastaction part may not be<br>necessary for anyone else, but on occasion it seemed to be necessary<br>for us, and rather than spending much time looking into the underlying<br>cause I'm okay with this solution.<br><br>Nathan<br><br>/etc/logrotate.d/varnish<br>===========================<br>/var/log/varnish/varnish.log {<br>  daily<br>  rotate 52<br>  compress<br>  create<br>  delaycompress<br>  dateext<br>  postrotate<br>    /usr/sbin/invoke-rc.d varnishlog reload > /dev/null<br>    DATE=$(date +%Y%m%d)<br>    VDIR=/var/log/varnish<br>    # varnishlog or varnishncsa(??) seems to produce a lot of entries<br>that are null,<br>    # the grep -v in the middle just attempts to eliminate them<br>    /usr/bin/ionice -c3 /usr/bin/varnishncsa -r<br>$VDIR/varnish.log-$DATE | grep -v '^- - -' | gzip ><br>$VDIR/varnish.log-$DATE.gz && rm $VDIR/varnish.log-<br>$DATE<br>  endscript<br>  lastaction<br>    # Sometimes, for reasons that I can't explain, varnishlog stops<br>logging after<br>    # rotation.  The new log just sits there at 0 bytes and it takes a reload to<br>    # make it start logging again.  It could be some complex timing issue, but<br>    # hopefully just adding one last restart of varnishlog will be enough.<br>    /usr/sbin/invoke-rc.d varnishlog force-reload > /dev/null<br>  endscript<br>}<br>===========================<br></div></blockquote></div><br></div></body></html>