You are not logged in.

#1 2019-12-08 10:13:23

BentB
Member
From: Birkerød, Denmark
Registered: 2007-01-17
Posts: 22
Website

systemd reloads Apache once a week

Every Sunday morning at 00:00 systemd decides to reload the Apache web server. This reload starts an avalanche of core dumps that effectively takes Apache out of service. The avalanche stops when I manually restarts Apache with systemctl.

Since I consider reloading of Apache unnecessary I would like to know:
1. Why is Apache reloaded?
2. How is the reload initiated?

Question 2 is posed because I cannot see anything that should do it. The is no systemd timer for it , nothing in /etc/cron.weekly, and nothing in the service script for httpd (Apache).

Please enlighten me.

Offline

#2 2019-12-08 10:41:59

glitsj16
Member
Registered: 2015-04-26
Posts: 116

Re: systemd reloads Apache once a week

The reload might be initiated via logrotate. Have you checked /etc/logrotate.d/httpd yet?

Offline

#3 2019-12-08 14:47:58

BentB
Member
From: Birkerød, Denmark
Registered: 2007-01-17
Posts: 22
Website

Re: systemd reloads Apache once a week

glitsj16 wrote:

Have you checked /etc/logrotate.d/httpd yet?

No, I hadn't, but now I have - and you are absolutely right. Logrotate's postrotate command for httpd reads:

/usr/bin/systemctl reload httpd.service 2>/dev/null || true

It also gives both the 'why' and the 'how', so I got my two questions answered in one smile

After I submitted my question I checked with journalctl and found that the reload has been done 'forever' but it hasn't given rise to core dump avalanches until recently, so I guess it could be an error somewhere in systemd.  In another thread it saw thar somebody was asked if he had updated to version 244-1 of systemd. I'm right now running version 243.162-2. It will be updated this night so we shall see next Sunday whether or not there will be another avalanche.

Thanks for the quick and helpful answer.

Offline

#4 2019-12-08 21:26:02

glitsj16
Member
Registered: 2015-04-26
Posts: 116

Re: systemd reloads Apache once a week

Glad you found the culprit. If you want to see if log rotation works as expected or if you get the 'avalanche', you don't need to wait until next sunday. If weekly is in /etc/logrotate.d/httpd without specifying a weekday argument it defaults to 0 (sunday) according to man logrotate. So you can temporarily change that to test whenever you like. Or run sudo logrotate --force /etc/logrotate.d/httpd to force a rotation. Hope this clears up any confusion regarding logrotate.

Offline

#5 2019-12-11 09:06:28

BentB
Member
From: Birkerød, Denmark
Registered: 2007-01-17
Posts: 22
Website

Re: systemd reloads Apache once a week

I have done the exercise you recommend above and there was no 'avalanche'. The previous  avalanche began appr. 3 second after the reload and then continued with 5 core dumps per second until I stopped it by restarting Apache. This time none of this happened, so I assumed that my theory about something rotten in the state of systemd (I'm Danish smile)  is correct, because systemd was updated Monday morning in the weekly server update.

Thanks again for putting me on the right track.

Offline

Board footer

Powered by FluxBB