Bug 37413 - www/apache13 port installs broken apache.sh startup script
Summary: www/apache13 port installs broken apache.sh startup script
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-04-24 12:10 UTC by Jason Mann
Modified: 2002-04-24 14:42 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Mann 2002-04-24 12:10:01 UTC
Due to an error in the Makefile for the www/apache13 port, the startup script installed for the apache13 port does not function correctly.

The makefile uses sed to replace occurences of '%%PREFIX%%' in a template script (files/apache.sh) with a real path, usually /usr/local. However, due to a lack of 'g' option on the sed statement, only the first instance of %%PREFIX%% on any given line is replaced.

Hence, this line in the template file:

[ -x %%PREFIX%%/sbin/apachectl ] && %%PREFIX%%/sbin/apachectl start > /d
ev/null && echo -n ' apache'

should end up like:

[ -x /usr/local/sbin/apachectl ] && /usr/local/sbin/apachectl start > /d
ev/null && echo -n ' apache'

but in fact ends up like:

[ -x /usr/local/sbin/apachectl ] && %%PREFIX%%/sbin/apachectl start > /d
ev/null && echo -n ' apache'

This is sufficient to make the script non-functional and prevent apache from being started at boot.

Fix: 

There are a couple of fixes:

1. One could manually edit /usr/local/etc/rc.d/apache.sh and replace the missed instance of %%PREFIX%% with the correct path.

2. One could edit the apache13 makefile and add the 'g' option to the relevant sed statement e.g.

post-extract:
        @${SED} -e "s=%%PREFIX%%=${PREFIX}=g" ${FILESDIR}/apache.sh \
                > ${WRKSRC}/apache.sh

sed would then replace %%PREFIX%% globally on each line of the startup script, instead of just the first instance.
How-To-Repeat: Install the current apache13 port with the Makefile dated as follows:

# $FreeBSD: ports/www/apache13/Makefile,v 1.110 2002/04/22 03:26:11 dinoex Exp $
#
Comment 1 Andrey A. Chernov freebsd_committer freebsd_triage 2002-04-24 14:42:16 UTC
State Changed
From-To: open->closed

Fixed