newsyslog and apache

Ian Smith smithi at nimnet.asn.au
Fri Oct 3 17:48:05 UTC 2008


On Fri, 03 Oct 2008 10:08:52 +0200 "DA Forsyth" <d.forsyth at ru.ac.za> wrote:
 > On 2 Oct 2008 , freebsd-questions-request at freebsd.org entreated about
 >  "freebsd-questions Digest, Vol 235, Issue 11":

I'm replying to the digest too, so threading is doubly screwed :)

 > > No need to change log rotation software since the problem clearly is
 > > somewhere else. You need to inspect Apache's error logs to see why it
 > > cannot start.
 > 
 > the previous error log shows
 > [Wed Oct 01 08:00:03 2008] [notice] Graceful restart requested, doing 
 > restart
 > [Wed Oct 01 08:00:04 2008] [notice] seg fault or similar nasty error 
 > detected in the parent process

This is what you need to find and fix.  Most likely a config error of 
some sort .. possibly re some module - php extensions order, maybe?

What does 'apachectl configtest' have to say?
 
 > the new error log shows, after the manual start
 > [Wed Oct 01 08:39:09 2008] [warn] pid file /var/run/httpd.pid 
 > overwritten -- Unclean shutdown of previous Apache run?
 > [Wed Oct 01 08:39:09 2008] [notice] Apache/2.0.63 (FreeBSD) PHP/4.4.9 
 > with Suhosin-Patch DAV/2 SVN/1.5.2 configured -- resuming normal 
 > operations
 > 
 > those error messages are repeated any time I do a 
 >    apachectl graceful
 > 
 > However, doing
 >    apachectl stop
 >    apachectlstart
 > works as expected.

See apachectl(8) .. apachectl graceful sends httpd a SIGUSR1, as does 
your previously mentioned newsyslog line, which shuts apache down but 
without murdering existing connections, while apachectl restart does.

However both graceful and restart run configttest before restarting, and 
it seems likely that's where/why it's bombing.  OTOH, apachectl start 
doesn't run configtest, maybe explaining why it starts up ok that way?

 > apache version is apache-2.0.63_2 from ports
 > uname -a gives
 > FreeBSD iwr.ru.ac.za 7.0-RELEASE-p1 FreeBSD 7.0-RELEASE-p1 #2: Mon 
 > Jun  2 13:10:26 SAST 2008     
 > iwr.ru.ac.za:/usr/obj/usr/src/sys/KERNIWR70  i386

Here running apache 1.3 on 5.5-STABLE, but I doubt the apachectl 
functionality has changed significantly, though I may be wrong ..

 > php v4 is installed, though i do plan to upgrade that to V5 as soon 
 > as I get time to do it.

Good idea, especially if PHP is related to your apparent config issue.

 > PS: I used to use logrotate, but it too stopped working correctly, 
 > with apache process stopping in a similar way that is why I changed 
 > to newsyslog.  I rotate the logs monthly, and set it to 8am so there 
 > is a chance I'll be on hand to start apache to minimize downtime.

Theoretically if it survives an apachectl configtest, you should be 
good to go - and if it doesn't, neither method will restart apache.

cheers, Ian


More information about the freebsd-questions mailing list