Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Nov 1997 07:33:20 +0000
From:      Ian Vaudrey <i.vaudrey@cableinet.co.uk>
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   ports/5080: Apache-1.2.4: Improved rc.d script
Message-ID:  <3.0.3.32.19971118073320.007963d0@mail.cableinet.co.uk>
Resent-Message-ID: <199711180740.XAA00265@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         5080
>Category:       ports
>Synopsis:       Apache-1.2.4: Improved rc.d script
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Nov 17 23:40:00 PST 1997
>Last-Modified:
>Originator:     Ian Vaudrey
>Organization:
>Release:        FreeBSD 2.2-STABLE i386
>Environment:

	2.2-STABLE

>Description:

	The Apache-1.2.4 port installs a startup script with /usr/local hardwired
	into it. The script also fails to honour start/stop parameters.

>How-To-Repeat:

>Fix:

	The following diffs fix these problems. They also change direct use of
	echo, mv and sed in the Makefile to indirect use, which stops portlint
	complaining. Please review and commit.

	NOTE: 1 new file - files/apache.sh.tmpl

diff -ruN apache.orig/Makefile apache/Makefile
--- apache.orig/Makefile	Mon Nov 17 13:04:58 1997
+++ apache/Makefile	Mon Nov 17 13:09:43 1997
@@ -23,16 +23,16 @@
 .if defined(VERS_ID)
 post-patch:
 	@cd ${WRKSRC}/src && \
-	mv Configuration Configuration.old && \
-	sed 's;^#*OPTIM=.*;OPTIM= -DSERVER_SUBVERSION=\\"${VERS_ID}\\";' \
+	${MV} Configuration Configuration.old && \
+	${SED} 's;^#*OPTIM=.*;OPTIM= -DSERVER_SUBVERSION=\\"${VERS_ID}\\";' \
 	< Configuration.old > Configuration
 .endif
 
 post-install:
 	@if [ ! -f ${PREFIX}/etc/rc.d/apache.sh ]; then \
-		echo "Installing ${PREFIX}/etc/rc.d/apache.sh startup file."; \
-		echo "#!/bin/sh" > ${PREFIX}/etc/rc.d/apache.sh; \
-		echo "[ -x /usr/local/sbin/httpd ] && /usr/local/sbin/httpd && echo -n '
httpd'" >> ${PREFIX}/etc/rc.d/apache.sh; \
+		${ECHO} "Installing ${PREFIX}/etc/rc.d/apache.sh startup file."; \
+		${SED} 's;PREFIX;${PREFIX};' < ${FILESDIR}/apache.sh.tmpl \
+		> ${PREFIX}/etc/rc.d/apache.sh; \
 		chmod 751 ${PREFIX}/etc/rc.d/apache.sh; \
 	fi
 .for i in ${MAN1}
diff -ruN apache.orig/files/apache.sh.tmpl apache/files/apache.sh.tmpl
--- apache.orig/files/apache.sh.tmpl	Thu Jan  1 01:00:00 1970
+++ apache/files/apache.sh.tmpl	Mon Nov 17 12:49:02 1997
@@ -0,0 +1,26 @@
+#!/bin/sh
+#
+
+case "$1" in
+
+start)
+	if [ -x PREFIX/sbin/httpd ]
+	then
+		PREFIX/sbin/httpd && echo -n ' httpd'
+	fi
+	;;
+
+stop)
+	if [ -r /var/run/httpd.pid ]
+	then
+		kill -TERM `cat /var/run/httpd.pid` && echo -n ' httpd'
+	fi
+	;;
+
+*)
+	echo "usage: $0 {start|stop}" 1>&2
+	exit 64
+	;;
+
+esac
+


>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3.0.3.32.19971118073320.007963d0>