9dbbcb3f02
Changelog: - Update to CVS as of 2007-06-23, i.e. include all applicable PatchSets up to PatchSet 10865. - Due to popular demand introduce squid_pidfile as rc(8) tunable; it defaults to ${PREFIX}/squid/logs/squid.pid. Document the need to tweak this variable in squid.conf.default if the administrator chooses to change this default in Squid's configuration. - install a new basic auth helper "DB" that is used to get user/password information via a SQL database accessible with Perl's DBI; install the example SQL script to create such a database in ${EXAMPLESDIR} - Apply some cleanups in Makefile: * prefer PatchSet over ChangeSet consistently * improve handling of debugging options * note that Squid-3's kqueue(2) is still considered experimental by the Squid developers (but keep it enabled by default) PR: 113997 Submitted by: Thomas-Martin Seck <tmseck@netcologne.de> (maintainer)
60 lines
1.4 KiB
Bash
60 lines
1.4 KiB
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
# PROVIDE: squid
|
|
# REQUIRE: LOGIN
|
|
# KEYWORD: shutdown
|
|
#
|
|
# Note:
|
|
# Set "squid_enable=yes" in either /etc/rc.conf, /etc/rc.conf.local or
|
|
# /etc/rc.conf.d/squid to make this script actually do something. There
|
|
# you can also set squid_chdir, squid_pidfile, squid_user, and squid_flags.
|
|
#
|
|
# Please see squid(8), rc.conf(5) and rc(8) for further details.
|
|
#
|
|
|
|
squid_checkrunning() {
|
|
${command} ${squid_flags} -k check 2>/dev/null
|
|
}
|
|
|
|
squid_stop() {
|
|
echo "Stopping ${name}."
|
|
${command} ${squid_flags} -k shutdown
|
|
run_rc_command poll
|
|
}
|
|
|
|
. %%RC_SUBR%%
|
|
|
|
name=squid
|
|
rcvar=${name}_enable
|
|
|
|
command=%%PREFIX%%/sbin/squid
|
|
extra_commands=reload
|
|
reload_cmd="${command} ${squid_flags} -k reconfigure"
|
|
stop_precmd="squid_checkrunning"
|
|
stop_cmd="squid_stop"
|
|
|
|
load_rc_config ${name}
|
|
|
|
squid_chdir=${squid_chdir:-"%%PREFIX%%/squid/logs"}
|
|
squid_enable=${squid_enable:-"NO"}
|
|
squid_flags=${squid_flags-"-D"}
|
|
squid_pidfile=${squid_pidfile:-"%%PREFIX%%/squid/logs/squid.pid"}
|
|
squid_user=${squid_user:-%%SQUID_UID%%}
|
|
default_config=%%PREFIX%%/etc/squid/squid.conf
|
|
|
|
pidfile=${squid_pidfile}
|
|
required_dirs=${squid_chdir}
|
|
|
|
# squid(8) will not start if ${default_config} is not present so try
|
|
# to catch that beforehand via ${required_files} rather than make
|
|
# squid(8) crash.
|
|
# If you remove the default configuration file make sure to add
|
|
# '-f /path/to/your/squid.conf' to squid_flags
|
|
|
|
if [ -z "${squid_flags}" ]; then
|
|
required_files=${default_config}
|
|
fi
|
|
|
|
run_rc_command "$1"
|