I am running my sync gateway on CentOS 7.2
I have setup the logrotate configuration under /etc/logrotate.d/
/home/sync_gateway/logs/*.log {
su sync_gateway sync_gateway
daily
rotate 2
size 10M
dateext
dateyesterday
missingok
delaycompress
compress
postrotate
/usr/bin/pkill -HUP sync_gateway > /dev/null
endscript
}
Also i modified the sync_gateway.service file under /usr/lib/systemd/system/ to have the sync gateway startup with the logFilePath option
ExecStart=/usr/bin/bash -c ‘${GATEWAY} -logFilePath=${LOGS}/${NAME}_error.log ${CONFIG}’
However, the log files are not rotated daily. I tried with logrotate -d option to see any potential issues and everything looks good,also when i manually invoke logrotate against the sync gateway configuration it works, just that it doesn’t rotate daily using the cron job. I verified also that the cron job status shows logrotate has ‘finished’ running.
Has anyone else faced a similar issue?