Macports, Apache PATH evn?

Scott Haneda talklists at newgeo.com
Sat May 15 17:05:47 PDT 2010


On May 15, 2010, at 3:13 PM, Ryan Schmidt wrote:

> The purpose of launchd is to notice when programs exit unexpectedly and to then relaunch them. Using apachectl to stop or restart Apache2 amounts to it unexpectedly quitting in the eyes of launchd, which would cause launchd to try to launch it again. This is why I don't recommend using apachectl if you're using launchd. Apache's graceful restart feature is very nice, but I don't know what happens when you try to use that when you're already using launchd.

I think a little bit of a mess happens.  I used to use "graceful" all the time, but then I would add a new module or something to Apache, issue a graceful, and find strange behavior.  Sometimes it was as if I had installed something new, other times it was as if I had not.  I think I was hooking into some other worker, or had one already in progress, and things must have gotten confused.

I have at times relied on the fact that launchd wants to restart anything that dies or otherwise stops working.  If I have a pid nearby, it can be pretty easy to just kill it off and let launchd come to the party and kick things back into gear again.  Other times, launchd has confused the heck out of me, I just want something to go away, and it is quick at bringing it back, so it looks as though you never nuked it, until you look at the pid number and see it has changed.

Previously it was said that you need to issue a full stop, and then a start to correctly reload/restart Apache.  Do you really need the start?  launchd should come along and start it back up again I believe.  If you really want to stop, then start, I think you would have to first unload the launchd item, stop Apache, start Apache, and then load back in the launchd item as a means to keep it up in the event of crashes or trouble.  Or I suppose you could unload the launchd item, stop Apache, and then load the lauchd item, which will in turn start Apache up for you.
-- 
Scott * If you contact me off list replace talklists@ with scott@ * 



More information about the macports-users mailing list