mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-22 18:25:56 +01:00
0585b148c7
Logrotate is run with sudo as the syslog user by cron.hourly The current working directory is `/root` which is inaccessible to the syslog user so the logrotate command fails. Currently the following stderr is being thrown away by the cron script: ``` error: cannot open current directory: Permission denied ``` Fixes #15468 Signed-off-by: Christopher Jenkins <christj@gmail.com>
8 lines
256 B
Bash
Executable File
8 lines
256 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# 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
|