Skip to content

Fixes crash when logrotate fails #1255

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

Merged
merged 2 commits into from
Jul 23, 2021
Merged

Conversation

chaptergy
Copy link
Collaborator

Fixes #1250
Somehow the owner of the logs is sometimes not root, which causes logrotate to fail. This makes sure that a failing of logrotate does not crash npm.

@jc21
Copy link
Member

jc21 commented Jul 22, 2021

This is an automated message from CI:

Docker Image for build 1 is available on DockerHub as jc21/nginx-proxy-manager:github-pr-1255

Note: ensure you backup your NPM instance before testing this PR image! Especially if this PR contains database changes.

@chaptergy chaptergy mentioned this pull request Jul 22, 2021
@jc21
Copy link
Member

jc21 commented Jul 22, 2021

So this just logs the problem but doesn't really fix it. In addition to this change you can add a new file

docker/rootfs/etc/cont-init.d/01-perms

and chmod +x it before committing it. In this file, you can perform operations that are executing at container start:

#!/usr/bin/with-contenv bash

mkdir -p /data/logs
chown -R root:root /data/logs

@chaptergy
Copy link
Collaborator Author

Well It fixes the npm crashing problem not the logrotate problem, yeah.

But with the chown at container start is a great idea, I wouldn'tve thought of that

@chaptergy
Copy link
Collaborator Author

Works as expected. Let's hope this won't break accessing the logs for anyone 🤞

@jc21
Copy link
Member

jc21 commented Jul 23, 2021

This is an automated message from CI:

Docker Image for build 2 is available on DockerHub as jc21/nginx-proxy-manager:github-pr-1255

Note: ensure you backup your NPM instance before testing this PR image! Especially if this PR contains database changes.

@jc21 jc21 merged commit 6f3a00c into develop Jul 23, 2021
@jc21 jc21 deleted the fixes-crash-when-logrotation-fails branch September 8, 2021 22:05
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

Successfully merging this pull request may close these issues.

v2.9.5 Breaks my Setup and constantly get HHTP 502 BadGateway when I try to login
2 participants