Merge pull request #15527 from sevendials/logrotate_fails_when_cwd_is_not_readable

Logrotate fails when cwd is not accessible
This commit is contained in:
Wenkai Yin(尹文开) 2021-09-13 16:08:23 +08:00 committed by GitHub
commit 3ce072016f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,5 +2,6 @@
# run the logrotate with user 10000, the state file "/var/lib/logrotate/logrotate.status"
# is specified to avoid the permission error
cd /
sudo -u \#10000 -E /usr/sbin/logrotate -s /var/lib/logrotate/logrotate.status /etc/logrotate.conf
exit 0
exit 0