This is on CentOS 7. I have set /etc/logrotate.conf to rotate log files "daily", this happens every night. But it causes a apache restart, wich I do not like. I would like Apache to reload instead of restart.
I struggle to find the information I need to make this change. I have been looking at /etc/logrotate.d/apache wich contain this:
I am considering changing this line:
with this line:
Is that the correct way to change it so that Apache is not restarted every night by logrotate but instead reloaded? Hopefully someone have experience changing this and can provide information about the correct way of changing this.
I struggle to find the information I need to make this change. I have been looking at /etc/logrotate.d/apache wich contain this:
Code:
/var/log/httpd/access_log /var/log/httpd/agent_log /var/log/httpd/error_log /var/log/httpd/referer_log /var/log/httpd/suexec_log /var/log/suphp.log /var/log/httpd/sulsphp_log {
missingok
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null || true
endscript
}
I am considering changing this line:
Code:
/bin/kill -HUP `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null || true
with this line:
Code:
/bin/systemctl reload httpd.service > /dev/null 2>/dev/null || true
Is that the correct way to change it so that Apache is not restarted every night by logrotate but instead reloaded? Hopefully someone have experience changing this and can provide information about the correct way of changing this.