Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have an Apache/2.2.22 (Linux/SUSE) and it automatically restarts every day at the same time. I have no cron jobs configured to do that on any user.

I started collecting minutelly snapshots of the status page and from that I found out that:

Restart Time: Friday, 31-Jan-2014 12:15:03 EET
Restart Time: Saturday, 01-Feb-2014 12:15:04 EET
Restart Time: Sunday, 02-Feb-2014 12:15:05 EET
Restart Time: Monday, 03-Feb-2014 12:15:06 EET

From the miuntelly snapshots of the status page it turns out that no significance traffic occurst before the restart.

For each restart I get the following /var/log/messages without anything else of interest:

2014-02-03T12:15:02.576970+02:00 foobar systemd[1]: Reloading apache.
2014-02-03T12:15:03.225024+02:00 foobar start_apache2[15393]: Syntax OK
2014-02-03T12:15:03.298169+02:00 foobar systemd[1]: Reloaded apache.

Any ideas why this is happening or where should I look at next?

share|improve this question

1 Answer 1

up vote 5 down vote accepted

Apache isn't being restarted (which implies shutting it down and starting it again). Instead, it's re-reading its config file.

I'd lay a bet that this is caused by your logrotation software.

If logs are rotated by moving the log to a new name, and creating a new file with the old name, then you need to restart apache in order to make it begin using the new file. So when rotating apache logs, you need to one of two things:

  1. Do a reload of apache configuration (which will make it start using the new logfile),
  2. Don't move the old file - instead, copy the contents to the backup file name and empty the original.
share|improve this answer
1  
Thanks. That was it. The modification times of the access_log-YYYYMMDD.xz files confirm that. –  cherouvim Feb 3 at 11:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.