Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 May 2002 08:07:12 +0200 (CEST)
From:      dirk.meyer@dinoex.sub.org
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/37917: [PATCH] ports does not support local_startup in rc.conf
Message-ID:  <200205100607.g4A67CPS008393@home.dinoex.sub.org>

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

>Number:         37917
>Category:       ports
>Synopsis:       [PATCH] ports does not support local_startup in rc.conf
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu May 09 23:10:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Dirk Meyer
>Release:        FreeBSD 4.5-STABLE i386
>Organization:
privat
>Environment:
System: FreeBSD 4.5-STABLE i386

>Description:

	startscript does not work in other directories.

>How-To-Repeat:

Use a diffrent startup-dir so builds don't add services or samples.
/etc/rc.conf:
local_startup="/usr/local/etc/rc.local"

>Fix:

	Apply this patch:

diff squid24/Makefile squid24/Makefile
--- squid24/Makefile	Sat Mar 23 05:38:35 2002
+++ squid24/Makefile	Sat Apr 20 17:22:40 2002
@@ -95,6 +95,9 @@
 
 post-extract:
 	@${PERL} -pi -e 's|-lpthread|${PTHREAD_LIBS}|g' ${WRKSRC}/configure
+	@${SED} -e "s=%%PREFIX%%=${PREFIX}=g" ${FILESDIR}/squid.sh \
+		> ${WRKSRC}/squid.sh
+
 
 post-install:
 #	I don't think many people use the pinger nowadays, and if you
@@ -117,7 +120,7 @@
 	${CHOWN} nobody:nogroup ${PREFIX}/squid/cache
 	@if [ ! -f ${PREFIX}/etc/rc.d/squid.sh ]; then \
 		${ECHO} "Installing ${PREFIX}/etc/rc.d/squid.sh startup file."; \
-		${INSTALL_SCRIPT} -m 751 ${FILESDIR}/squid.sh ${PREFIX}/etc/rc.d/squid.sh; \
+		${INSTALL_SCRIPT} -m 751 ${WRKSRC}/squid.sh ${PREFIX}/etc/rc.d/squid.sh; \
 	fi
 
 .include <bsd.port.mk>
diff squid24/files/squid.sh squid24/files/squid.sh
--- squid24/files/squid.sh	Sat Sep  1 10:34:14 2001
+++ squid24/files/squid.sh	Sun Apr 21 05:58:19 2002
@@ -1,25 +1,23 @@
 #!/bin/sh
 
-if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
-    echo "$0: Cannot determine the PREFIX" >&2
-    exit 1
-fi
-
 case "$1" in
 start)
-	if [ -x ${PREFIX}/sbin/squid -a -f ${PREFIX}/etc/squid/squid.conf ]; then
-		(cd /${PREFIX}/squid/logs; ${PREFIX}/sbin/squid >/dev/null 2>&1 &) ; echo -n ' squid'
+	if [ -x %%PREFIX%%/sbin/squid -a -f %%PREFIX%%/etc/squid/squid.conf ]; then
+		(cd /%%PREFIX%%/squid/logs; %%PREFIX%%/sbin/squid >/dev/null 2>&1 &) ; echo -n ' squid'
 	fi
 	;;
 stop)
-		${PREFIX}/sbin/squid -k shutdown 2>&1
+		%%PREFIX%%/sbin/squid -k shutdown 2>&1
 		# Uncomment this if you'd like the system to (attempt to
 		# wait for) squid to shut down cleanly
 		#echo "Sleeping for 45 seconds to allow squid to shutdown.."
 		#sleep 45 
 	;;
+restart)
+		%%PREFIX%%/sbin/squid -k reconfigure
+	;;
 *)
-	echo "Usage: `basename $0` {start|stop}" >&2
+	echo "Usage: `basename $0` {start|stop|restart}" >&2
 	;;
 esac
 
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




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