Fix permission issue in job_log directory

This commit is contained in:
Tan Jiang 2017-11-21 19:31:15 +08:00
parent e60de3e39d
commit b3e0af2382
2 changed files with 4 additions and 1 deletions

View File

@ -5,5 +5,8 @@ fi
if [ -d /var/log/jobs ]; then
chown -R 10000:10000 /var/log/jobs/
fi
if [ -d /var/log/jobs/scan_job ]; then
chmod +x /var/log/jobs/scan_job
fi
sudo -E -u \#10000 "/harbor/harbor_jobservice"

View File

@ -28,7 +28,7 @@ func NewLogger(j Job) (*log.Logger, error) {
logFile := j.LogPath()
d := filepath.Dir(logFile)
if _, err := os.Stat(d); os.IsNotExist(err) {
err := os.MkdirAll(d, 0660)
err := os.MkdirAll(d, 0755)
if err != nil {
log.Errorf("Failed to create directory for log file %s, the error: %v", logFile, err)
}