Lines 8-21
Link Here
|
8 |
# |
8 |
# |
9 |
# Note: |
9 |
# Note: |
10 |
# Set "squid_enable=yes" in either /etc/rc.conf, /etc/rc.conf.local or |
10 |
# Set "squid_enable=yes" in either /etc/rc.conf, /etc/rc.conf.local or |
11 |
# /etc/rc.conf.d/squid to make this script actually do something. There |
11 |
# /etc/rc.conf.d/squid to activate Squid. |
12 |
# you can also set squid_chdir, squid_pidfile, squid_user, and squid_flags. |
|
|
13 |
# |
12 |
# |
14 |
# On FreeBSD 7.1 and beyond you can use squid_fib to set a different routing |
13 |
# Additional variables you can define in one of these files: |
15 |
# table for squid. See setfib(1) for details. |
|
|
16 |
# |
14 |
# |
17 |
# Please see squid(8), rc.conf(5) and rc(8) for further details. |
15 |
# squid_chdir: the directory into which the rc system moves into before |
|
|
16 |
# starting Squid. Default: %%PREFIX%%/squid |
18 |
# |
17 |
# |
|
|
18 |
# squid_conf: The configuration file that Squid should use. |
19 |
# Default: %%PREFIX%%/etc/squid/squid.conf |
20 |
# |
21 |
# squid_fib: The alternative routing table id that Squid should use. |
22 |
# Default: none |
23 |
# See setfib(1) for further details. Note that the setfib(2) |
24 |
# system call is not available in FreeBSD versions prior to 7.1. |
25 |
# |
26 |
# squid_user: The user id that should be used to run the Squid master |
27 |
# process. Default: %%SQUID_UID%%. |
28 |
# Note that you probably need to define "squid_user=root" if |
29 |
# you want to run Squid in reverse proxy setups or if you want |
30 |
# Squid to listen on a "privileged" port < 1024. |
31 |
# |
32 |
# squid_pidfile: |
33 |
# The name (including the full path) of the Squid |
34 |
# master process' PID file. |
35 |
# Default: %%PREFIX%%/squid/squid.pid. |
36 |
# You only need to change this if you changed the |
37 |
# corresponding entry in your Squid configuration. |
38 |
# |
39 |
# squid_flags: Additional commandline arguments for Squid you might want to |
40 |
# use. See squid(8) for further details. |
41 |
# |
19 |
|
42 |
|
20 |
squid_checkrunning() { |
43 |
squid_checkrunning() { |
21 |
${command} ${squid_flags} -k check 2>/dev/null |
44 |
${command} ${squid_flags} -k check 2>/dev/null |
Lines 51-74
Link Here
|
51 |
load_rc_config ${name} |
74 |
load_rc_config ${name} |
52 |
|
75 |
|
53 |
squid_chdir=${squid_chdir:-"%%PREFIX%%/squid/logs"} |
76 |
squid_chdir=${squid_chdir:-"%%PREFIX%%/squid/logs"} |
|
|
77 |
squid_conf=${squid_conf:-"%%PREFIX%%/etc/squid/squid.conf"} |
54 |
squid_enable=${squid_enable:-"NO"} |
78 |
squid_enable=${squid_enable:-"NO"} |
55 |
squid_fib=${squid_fib:-"NONE"} |
79 |
squid_fib=${squid_fib:-"NONE"} |
56 |
squid_flags=${squid_flags-"-D"} |
80 |
squid_flags=${squid_flags-"-D"} |
57 |
squid_pidfile=${squid_pidfile:-"%%PREFIX%%/squid/logs/squid.pid"} |
81 |
squid_pidfile=${squid_pidfile:-"%%PREFIX%%/squid/logs/squid.pid"} |
58 |
squid_user=${squid_user:-%%SQUID_UID%%} |
82 |
squid_user=${squid_user:-%%SQUID_UID%%} |
59 |
default_config=%%PREFIX%%/etc/squid/squid.conf |
|
|
60 |
|
83 |
|
61 |
pidfile=${squid_pidfile} |
84 |
pidfile=${squid_pidfile} |
62 |
required_dirs=${squid_chdir} |
85 |
required_dirs=${squid_chdir} |
63 |
|
86 |
|
64 |
# squid(8) will not start if ${default_config} is not present so try |
87 |
# squid(8) will not start if ${squid_conf} is not present so try |
65 |
# to catch that beforehand via ${required_files} rather than make |
88 |
# to catch that beforehand via ${required_files} rather than make |
66 |
# squid(8) crash. |
89 |
# squid(8) crash. |
67 |
# If you remove the default configuration file make sure to add |
|
|
68 |
# '-f /path/to/your/squid.conf' to squid_flags |
69 |
|
90 |
|
70 |
if [ -z "${squid_flags}" ]; then |
91 |
required_files=${squid_conf} |
71 |
required_files=${default_config} |
|
|
72 |
fi |
73 |
|
92 |
|
74 |
run_rc_command "$1" |
93 |
run_rc_command "$1" |