When using the latest apache20 port (from July 14 2006 portsnap) and the profiles feature to run multiple httpd's on one system (or even just a single profile), such as the following in /etc/rc.conf: apache2_enable="YES" apache2_profiles="0DEV" apache2_0DEV_flags="-DServer0DEV" apache2_0DEV_configfile="/usr/local/etc/apache2/httpd2-test.conf" Manually using "/usr/local/etc/rc.d/apache2.sh start 0DEV" (or stop or reload or restart) works fine. Manually using "/usr/local/etc/rc.d/apache2.sh start" (or stop or reload but NOT restart) works fine. restart not working may be related to ports/86402 but that's not that this PR is about :) At system boot time though, it fails to start Apache with the following error: ===> apache2 profile: 0DEV /usr/local/etc/rc.d/apache2.sh: /etc/rc: Permission denied On line 73 of /usr/local/etc/rc.d/apache2.sh is a line "$0 $1 $profile" that's used to re-run apache2.sh for each individual profile. If I put $0 into the "echo" line above it, it says $0 is "/etc/rc.d" so it fails when it tries to re-run the wrong script. The upshot is I have to manually restart Apache after a reboot. At system shutdown $0 gets mangled into "/etc/rc.shutdown" instead of "/usr/local/etc/rc.d/apache2.sh" the same way. If I create a simple /usr/local/etc/rc.d/test.sh script containing just #!/bin/sh echo Hello, I seem to be $0 then it prints /usr/local/etc/rc.d/test.sh as expected. Putting that as the first line in /usr/local/etc/rc.d/apache.2.sh prints /etc/rc at startup, /etc/rc.shutdown at shutdown and /usr/local/etc/rc.d/apache2.sh when run manually. 'm not sure why that one is different. It does run earlier than some of the others. With no profiles enabled everything works fine because it never needs to reference $0 in that case. Fix: Using $_file instead of $0 works for system boot but breaks the manual case. Perhaps using $_file if it exists and $0 when it doesn't? There is the possibility that I've done something stupid to my /etc/rc.conf, (like not using the apache20 profile variables correctly) or that I have another port whose rc.d script is trashing $0 somehow, or that I just plain don't understand the rc system. :) How-To-Repeat: Install www/apache20 on a system (or jail), add the above variables to /etc/rc.conf, and restart the system (or jail); if a jail then check /var/log/console.log for the above error messages.
Responsible Changed From-To: freebsd-ports-bugs->clement Over to maintainer
FWIW, I'm experiencing the same error today on 6.2/amd64 with the lastest apache 2.0.59 port.
Late followup: the www/apache22 port doesn't seem to have this problem. I don't know if the www/apache20 port has been fixed or not.
Responsible Changed From-To: clement->apache apache team
State Changed From-To: open->feedback Try this diff http://people.freebsd.org/~pgollucci/www_apache20-2.0.63.diff
State Changed From-To: feedback->closed feed back timeout (1.5 months from committers)