-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Make logrotate use the proper user and group. #3219
Conversation
Docker Image for build 1 is available on DockerHub as Note: ensure you backup your NPM instance before testing this PR image! Especially if this PR contains database changes. |
Here's the listing before (sorry for my egregious amount of proxy hosts).
And here's the logrotate command output and directory listing afterwards.npm@1394d9770a85:/app$ logrotate -fv /etc/logrotate.d/nginx-proxy-manager
npm@1394d9770a85:/app$ ls -al /data/logs
If testing, remember to exec into the container with |
@masterwishx Please create a discussion about this issue. Include your compose file and a screenshot of the output of the command |
Fixes #2938.
As seen in that issue, users are seeing an error when logrotate tries to own log files as root:
where /data/logs/<anything> is the log failing to be owned. This causes logrotate to never be able to compress and delete logs.
Since the logrotate configuration was made before (the better) user and group configuration was implemented earlier this year, it was written to own the files as root.
This pull makes logrotate create the logs as whoever owned them beforehand by removing the explicit root user and group in the
create
directive. It also makes logrotate perform all actions as npm:npm, to ensure it doesn't regress #1250.It will also work when running as root, as when a PUID and PGID is not set, the npm:npm user/group will have the uid/gid of 0.