Problems with Apache2 starting up

Ryan Schmidt ryandesign at macports.org
Wed Jan 28 01:34:33 PST 2009


On Jan 27, 2009, at 22:14, Jeff Stubbs wrote:

> I've used MP to build an Apache2/MySQL/PHP5 server for spouse's  
> employer last November. Since startup then, everything has worked  
> fine. However, late yesterday afternoon, I got a call that the  
> sites weren't accessible. Since I was a work, I told them just to  
> restart the machine. Machine restarted fine, but Apache2 didn't  
> start up on boot. SSH'd in and ran 'top', no httpd processes were  
> running. Launchctl showed that the plist file was already loaded.  
> Using the apachectl command (MP's, not Apples), the server started  
> up. Just for kicks, this evening I restarted the machine, Apache2  
> wasn't heard from, but will start from the command line. Anyone one  
> experiencing the same problem?
>
> Machine Data: dual 1.8 Ghz G5, OS X.5.5,
> MacPorts 1.700, Apache 2.2.10, MySQL 5.0.67, PHP 5.2..6
>
> Some of the installed ports are now slightly out of date, but  
> shouldn't suddenly cause problems. Two Daemondo processes are  
> running after starting apache. I usually scan the user & dev lists,  
> but don't recall anyone reporting a similar problem.

Yes. I use lighttpd more than apache2, but on one of my machines, a  
Power Mac G4 with Mac OS X 10.5.6, it never starts lighttpd at  
startup time, though the plist gets loaded. I have to "sudo port  
unload lighttpd" and then "sudo port load lighttpd" to get it to load  
properly.

I believe it has to do with the order in which plists are loaded. At  
the time the OS tries to load the lighttpd plist, probably the  
network stack or some other service that lighttpd vitally needs has  
not yet been brought up, so lighttpd cannot start.

The launchd plist syntax provides for a way to specify what other  
services must be started first. However MacPorts exposes no mechanism  
by which those fields of the plist could be filled -- at least, not a  
way they could be configured by the portfile. Though it might not be  
unreasonable for MacPorts to just decide that all launchd plists  
require network access.

On another machine, a MacBook Pro with Mac OS X 10.4.11, lighttpd has  
no trouble starting up at system startup time. I haven't yet done  
enough testing to know whether it's the OS version or the difference  
in CPU speed that's making this show up on the Power Mac but not the  
MacBook Pro. It's probably not any of those that are actually  
responsible for the problem -- it's probably just a coincidence with  
differences in how long different things take to get going at  
startup, i.e. it's just luck that it's working correctly when it is.




More information about the macports-users mailing list