geerlingguy / ansible-role-varnish

Ansible Role - Varnish HTTP accelerator
https://galaxy.ansible.com/geerlingguy/varnish/
MIT License
80 stars 88 forks source link

Fail to rotate logs for varnishncsa #74

Closed xlr-8 closed 4 years ago

xlr-8 commented 6 years ago

When installing the role on Debian Jessie, the logrotation seems to have a bug: The cron complains of the following issue:

/etc/cron.daily/logrotate:
error: error running non-shared postrotate script for /var/log/varnish/varnishncsa.log of '/var/log/varnish/varnishncsa.log '
run-parts: /etc/cron.daily/logrotate exited with return code 1

When looking at the configuration, it looks like invoke.rc has some issue with restarting the varnishncsa service. By updating it simply with:

/var/log/varnish/varnishncsa.log {
  daily
  rotate 7
  compress
  delaycompress
  missingok
  postrotate
    if [ -d /run/systemd/system ]; then
       systemctl -q is-active varnishncsa.service || exit 0
    fi
-    /usr/sbin/invoke-rc.d varnishncsa reload > /dev/null
+    systemctl reload varnishncsa.service > /dev/null
  endscript
}

Seem to solve this issue. Is it something you already encounter?

talset commented 6 years ago

I have the same issue. Any chance to have a look on it ?

Thanks !

stale[bot] commented 4 years ago

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

stale[bot] commented 4 years ago

This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.