summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authortaca <taca@pkgsrc.org>2008-03-11 15:46:41 +0000
committertaca <taca@pkgsrc.org>2008-03-11 15:46:41 +0000
commit6e9c1153f68e141c662b1c72215f587d2c1a1de8 (patch)
treef82c396ac28ab945c5ec2647065738ff9276b35b /www
parentbe38a2caa61d97244acb94c61f6a938775bd3d45 (diff)
downloadpkgsrc-6e9c1153f68e141c662b1c72215f587d2c1a1de8.tar.gz
Improve startup script:
- Revive support for system without NetBSD style rc/rc.d. - Always pass command_args and squid_flags to squid command. This should fix the PR pkg/38036 by Wolfgang Stukenbrock. Bump PKGREVISION.
Diffstat (limited to 'www')
-rw-r--r--www/squid/Makefile4
-rw-r--r--www/squid/files/squid.sh44
2 files changed, 22 insertions, 26 deletions
diff --git a/www/squid/Makefile b/www/squid/Makefile
index 91a8d9cbcb5..ca4944443d5 100644
--- a/www/squid/Makefile
+++ b/www/squid/Makefile
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.202 2008/01/18 05:09:53 tnn Exp $
+# $NetBSD: Makefile,v 1.203 2008/03/11 15:46:41 taca Exp $
DISTNAME= squid-2.6.STABLE18
PKGNAME= ${DISTNAME:S/STABLE//}
-PKGREVISION= 1
+PKGREVISION= 2
CATEGORIES= www
MASTER_SITES= http://www.squid-cache.org/Versions/v2/2.6/
EXTRACT_SUFX= .tar.bz2
diff --git a/www/squid/files/squid.sh b/www/squid/files/squid.sh
index 7ac39ab0f7a..b0fc69beea0 100644
--- a/www/squid/files/squid.sh
+++ b/www/squid/files/squid.sh
@@ -1,26 +1,31 @@
#!@RCD_SCRIPTS_SHELL@
#
-# $NetBSD: squid.sh,v 1.20 2008/01/31 20:01:13 adam Exp $
+# $NetBSD: squid.sh,v 1.21 2008/03/11 15:46:41 taca Exp $
#
# PROVIDE: squid
# REQUIRE: DAEMON
# KEYWORD: shutdown
-conf_file="@PKG_SYSCONFDIR@/squid.conf"
+if [ -f /etc/rc.subr ]; then
+ . /etc/rc.subr
+fi
+
+: ${squid_conf:=@PKG_SYSCONFDIR@/squid.conf}
name="squid"
rcvar=$name
command="@PREFIX@/sbin/${name}"
pidfile="@VARBASE@/run/${name}.pid"
-required_files="${conf_file} @PKG_SYSCONFDIR@/mime.conf"
-command_args="-Y -f $conf_file"
+required_files="${squid_conf} @PKG_SYSCONFDIR@/mime.conf"
+command_args="-Y -f ${squid_conf}"
stop_cmd="stop_nicely"
-kill_command="${command} -k shutdown"
-reload_cmd="${command} -k reconfigure"
-rotate_cmd="${command} -k rotate"
-createdirs_cmd="squid_createdirs"
+kill_command="${command} ${squid_flags} ${command_args} -k shutdown"
+reload_cmd="${command} ${squid_flags} ${command_args} -k reconfigure"
+rotate_cmd="${command} ${squid_flags} ${command_args} -k rotate"
+createdirs_cmd="${command} ${squid_flags} ${command_args} -z"
+extra_commands="createdirs reload rotate"
#### end of configuration section ####
@@ -51,25 +56,17 @@ stop_nicely ()
fi
}
-# create the squid cache directories
-squid_createdirs()
-{
- ${command} -z
-}
-
-if [ -f /etc/rc.subr -a -d /etc/rc.d -a -f /etc/rc.d/DAEMON ]; then
- . /etc/rc.subr
- . /etc/rc.conf
-
- extra_commands="createdirs reload rotate"
+if [ -f /etc/rc.subr -a -f /etc/rc.conf -a -f /etc/rc.d/DAEMON ]; then
load_rc_config $name
run_rc_command "$1"
-
else # old NetBSD, Solaris, Linux, etc...
-
+ if [ -f /etc/rc.conf ]; then
+ . /etc/rc.conf
+ fi
case $1 in
start)
- if [ -x ${command} -a -f ${conf_file} ] ; then
+ start_cmd="${command} ${squid_flags} ${command_args}"
+ if [ -x ${command} -a -f ${squid_conf} ] ; then
eval ${start_cmd} && @ECHO@ -n " ${name}"
fi
;;
@@ -77,7 +74,7 @@ else # old NetBSD, Solaris, Linux, etc...
${stop_cmd}
;;
createdirs)
- squid_createdirs
+ ${createdirs_cmd}
;;
reload)
if [ -f ${pidfile} ] ; then
@@ -94,5 +91,4 @@ else # old NetBSD, Solaris, Linux, etc...
exit 64
;;
esac
-
fi