Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenResty Ubuntu package has no logrotate configuration #70

Open
brendon opened this issue Nov 23, 2021 · 2 comments
Open

OpenResty Ubuntu package has no logrotate configuration #70

brendon opened this issue Nov 23, 2021 · 2 comments

Comments

@brendon
Copy link

brendon commented Nov 23, 2021

I was surprised to see that there is no logrotate configuration for the Ubuntu package. I only realised once the server ran out of space :D Here's what I ended up using:

var/log/openresty/*.log {
  daily
  missingok
  rotate 52
  compress
  delaycompress
  notifempty
  create 640 root root
  sharedscripts
  postrotate
    if [ -f /usr/local/openresty/nginx/logs/nginx.pid ]; then
      kill -USR1 `cat /usr/local/openresty/nginx/logs/nginx.pid`
    fi
  endscript
}

This is basically the same as the nginx Ubuntu 20.04 package's configuration with a tweak to the pid file location and the user and group of the log file ownership.

@xiaocang
Copy link

Hi @brendon, Thanks for the suggestion, logrotate relies on the logrotated service and the log path is customizable.
Of course, you can make your own debian package if you like, by modified the packaging script of this repo.

@brendon
Copy link
Author

brendon commented Nov 23, 2021

Thanks @xiaocang :) That's all good. I was just letting you know in case it was an oversight as I think people would probably expect the default logs to be rotated by default like the nginx package does. Perhaps on the Debian or Ubuntu package page you could add a little note about needing to manually do log rotation so that it doesn't catch people out?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants