Closed rsmuc closed 8 months ago
I'm having the same issue (Seafile CE 8.0.5) and running sv reload nginx
works. I'll have to manually edit /etc/logrotate.d/nginx
after every update until this is fixed.
From what I read in the Dockerfiles, this issue comes directly from the bundled logrotate config in the nginx apt package:
I don't know how to fix this, if not with a sed in the Dockerfile around here:
Adding sed -i 's/invoke-rc.d nginx rotate/sv reload nginx/' /etc/logrotate.d/nginx
could be enough.
Best!
I have the same problem.
Please replace the suggested line in the nginx logrotate configuration file.
Some other information that may help with the solution.
invoke-rc.d: policy-rc.d denied execution of rotate.
The reason for these message:
In the base image "phusion/baseimage:focal-1.0.0" invoke-rc.d service starting function is disabled by policy-rc.d file.
In the base image configuration file, this line creates the policy-rc.d:
... echo '#!/bin/sh' > /usr/sbin/policy-rc.d && echo 'exit 101' >> /usr/sbin/policy-rc.d && chmod +x /usr/sbin/policy-rc.d ...
invoke-rc.d: could not determine current runlevel
The reason for these message is the systemctl command can't determine the current and previous runlevels, because systemd isn't the init process.
invoke-rc.d uses the runlevel command, which is symlinked to systemctl:
lrwxrwxrwx 1 root root 14 Mar 17 2021 /usr/sbin/runlevel -> /bin/systemctl
The postrotate action for nginx logfiles is not working, so nginx will continue logging to e.g. access.log.1 and not to access.log after the first rotate, because nginx is not reloaded.
That is causing some trouble with fail2ban and maybe some trouble with diskspace after a long time.
Issue in /etc/logrotate.d/nginx:
Solution: