On 30/12/2013 15:44, Tanstaafl wrote:
>>> This happened by the way when the logs were rotated by logrotate. Maybe
>>> that is significant?
>>
>> Yes, that is highly significant.
>>
>> IIRC logrotate can work in one of two ways:
>>
>> 1. rename the log file and create a new empty one
>> 2. copy the log file elsewhere and truncate the original
>>
>> I forget which way it does it for the moment...
>>
>> #1 is fast but leaves the daemon (apache or syslog) trying to write to a
>> file that isn't there anymore. Or worse, it's writing to an open file
>> that has been deleted and a new one with the same name still exists.
>> #2 is slower but safer.
>>
>> Either way, the apache daemon has to be told it's log file went away.
>> Not all daemons can use inotify to just find this out, some have to be
>> told, so logrotate resets/restarts/hups them. In the case of apache it
>> does a graceful restart (what you get with apachectl graceful).
>>
>> Your apache re-read it's config file at that point, found any error for
>> php and decided to roll over and die.
> 
> Ok, but, if that is the case, why did it startup just fine when I simply
> did /etc/init.d/apache2 start? Shouldn't it have still died?


Logically, one would assume so. But that's not the full picture, many
other things could have happened in the interim. Portage could have been
busy with preserved libs in the background, later emerges could have
fixed some issue. Or maybe Apache was having a bad day.

These things happen, no use wondering about them, especially if they are
not reproducible. Instead:

/etc/init.d/apache2 start
apachectl graceful
apachectl reload

and check those commands do what they ought to. If so, shrug and get on
with real life. Not everything that happens on a computer is worth
spending brain cycles on, and not everything has a reason you can figure
out.

-- 
Alan McKinnon
alan.mckin...@gmail.com


Reply via email to