diff options
author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2009-10-13 18:51:10 +0000 |
---|---|---|
committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2009-10-13 18:51:10 +0000 |
commit | 7032b99a2848b30923f836fac79a5ae30ad26f46 (patch) | |
tree | 68b2a2d6e962af43c22c96f6a40f38309577eafc /www/varnish2/files | |
parent | Simple facade or abstraction for various logging frameworks (diff) |
Reorganize the rc scripts; there were several things about the old ones
that simply didn't make sense. Add a pkg-message containing a very brief
quick-start guide and a warning to existing users about the rc changes.
Notes
Notes:
svn path=/head/; revision=242785
Diffstat (limited to 'www/varnish2/files')
-rw-r--r-- | www/varnish2/files/pkg-message.in | 18 | ||||
-rw-r--r-- | www/varnish2/files/varnishd.in | 68 | ||||
-rw-r--r-- | www/varnish2/files/varnishlog.in | 34 | ||||
-rw-r--r-- | www/varnish2/files/varnishncsa.in | 34 |
4 files changed, 110 insertions, 44 deletions
diff --git a/www/varnish2/files/pkg-message.in b/www/varnish2/files/pkg-message.in new file mode 100644 index 000000000000..efba6a71ae4a --- /dev/null +++ b/www/varnish2/files/pkg-message.in @@ -0,0 +1,18 @@ +QUICK-START GUIDE + +It's two in the morning and someone posted a link to your website on +slashdot. Don't panic, it takes only a minute to set up Varnish in +front of your web server: + +1) Install Varnish +2) Reconfigure your web server to listen on localhost:8080 +3) echo 'varnishd_enable="YES"' >>/etc/rc.conf +4) %%PREFIX%%/etc/rc.d/varnishd + +Refer to the documentation for more advanced configuration. + +NOTE TO USERS UPGRADING FROM AN OLDER VERSION OF VARNISH: + +Several rc variables have been renamed and / or have new default +values. Refer to the comments in the rc.d scripts for a detailed +description of these variables. diff --git a/www/varnish2/files/varnishd.in b/www/varnish2/files/varnishd.in index 90195b126d5e..dab68e6c6217 100644 --- a/www/varnish2/files/varnishd.in +++ b/www/varnish2/files/varnishd.in @@ -8,45 +8,73 @@ # KEYWORD: shutdown # -# Add the following lines to /etc/rc.conf to enable varnishd: +# Add the following line to /etc/rc.conf to enable varnishd: # -#varnishd_enable="YES" +# varnishd_enable="YES" # # Configuration variables and their default values: # -#varnishd_listen=":6081" -#varnishd_config="%%PREFIX%%/etc/varnish/default.vcl" -#varnishd_telnet="localhost:6082" -#varnishd_storage="file,/tmp,50%" -#varnishd_user="www" -#varnishd_group="www" -#varnishd_flags="-P ${pidfile} -a ${varnishd_listen} -f ${varnishd_config} -T ${varnishd_telnet} -s ${varnishd_storage} -u ${varnishd_user} -g ${varnishd_group}" +# varnishd_pidfile - full path to the PID file. +# default: "/var/run/varnishd.pid" +# +# varnishd_listen - address and port at which varnishd will listen for +# client requests. +# default: ":80" +# +# varnishd_admin - address and port at which varnishd will listen for +# administrative commands. +# default: "localhost:81" +# +# varnishd_backend - address of the backend server. +# default: "localhost:8080" +# +# varnishd_config - name of the varnishd config file. +# default: unset. +# +# varnishd_storage - storage method and parameters. +# default: "file,/tmp,50%" +# +# varnishd_user - unprivileged user for the child process. +# default: "www" +# +# varnishd_group - unprivileged group for the child process. +# default: "www" +# +# varnishd_flags - complete command line arguments. +# default if varnishd_config is unset: "-P ${varnishd_pidfile} -a ${varnishd_listen} -T ${varnishd_admin} -b ${varnishd_backend} -s ${varnishd_storage} -u ${varnishd_user} -g ${varnishd_group}" +# default if varnishd_config is set: "-P ${varnishd_pidfile} -a ${varnishd_listen} -T ${varnishd_admin} -f ${varnishd_config} -s ${varnishd_storage} -u ${varnishd_user} -g ${varnishd_group}" # # See varnishd(1) for a detailed overview of command-line options. # . %%RC_SUBR%% -name=varnishd +name="varnishd" rcvar=`set_rcvar` -command="%%PREFIX%%/sbin/varnishd" -pidfile="/var/run/${name}.pid" +command="%%PREFIX%%/sbin/${name}" # read configuration and set defaults load_rc_config ${name} -: ${varnishd_enable="NO"} -: ${varnishd_listen=":6081"} -: ${varnishd_config="%%PREFIX%%/etc/varnish/default.vcl"} -: ${varnishd_telnet="localhost:6082"} -: ${varnishd_storage="file,/tmp,50%"} -: ${varnishd_user="www"} -: ${varnishd_group="www"} -: ${varnishd_flags="-P ${pidfile} -a ${varnishd_listen} -f ${varnishd_config} -T ${varnishd_telnet} -s ${varnishd_storage} -u ${varnishd_user} -g ${varnishd_group}"} +: ${varnishd_enable:="NO"} +: ${varnishd_pidfile:="/var/run/${name}.pid"} +: ${varnishd_listen:=":80"} +: ${varnishd_admin:="localhost:81"} +: ${varnishd_backend:="localhost:8080"} +: ${varnishd_config:=""} +: ${varnishd_storage:="file,/tmp,50%"} +: ${varnishd_user:="www"} +: ${varnishd_group:="www"} +if [ -n "${varnishd_config}" ] ; then + : ${varnishd_flags:="-P ${varnishd_pidfile} -a ${varnishd_listen} -T ${varnishd_admin} -f ${varnishd_config} -s ${varnishd_storage} -u ${varnishd_user} -g ${varnishd_group}"} +else + : ${varnishd_flags:="-P ${varnishd_pidfile} -a ${varnishd_listen} -T ${varnishd_admin} -b ${varnishd_backend} -s ${varnishd_storage} -u ${varnishd_user} -g ${varnishd_group}"} +fi # If we leave these set, rc.subr will su to them before starting # varnishd, which is not what we want. unset varnishd_user unset varnishd_group +pidfile="${varnishd_pidfile}" run_rc_command "$1" diff --git a/www/varnish2/files/varnishlog.in b/www/varnish2/files/varnishlog.in index 7d07528e7b52..dbd6a229c1b3 100644 --- a/www/varnish2/files/varnishlog.in +++ b/www/varnish2/files/varnishlog.in @@ -8,32 +8,42 @@ # KEYWORD: shutdown # -# Add the following lines to /etc/rc.conf to enable varnishlog: +# Add the following line to /etc/rc.conf to enable varnishlog: # -#varnishlog_enable="YES" +# varnishlog_enable="YES" # # Configuration variables and their default values: # -#varnishlog_file=${varnishlog_file:-"/var/log/varnish.log"} -#varnishlog_flags=${varnishlog_flags:-"-D -P ${pidfile} -a -w ${varnishlog_file}"} +# varnishlog_pidfile - full path to the PID file. +# default: "/var/run/varnishlog.pid" +# +# varnishlog_file - full path to the log file. +# default: "/var/log/varnish.log" +# +# varnishlog_flags - command line arguments. +# default: "-D -P ${varnishlog_pidfile} -a -w ${varnishlog_file}" +# +# Add the following line to /etc/newsyslog.conf to rotate the log file +# once a day: +# +# /var/log/varnish.log 640 7 * @T00 JB /var/run/varnishlog.pid # # See varnishlog(1) for a detailed overview of command-line options. # . %%RC_SUBR%% -name=varnishlog +name="varnishlog" rcvar=`set_rcvar` -command="%%PREFIX%%/bin/varnishlog" -pidfile="/var/run/${name}.pid" +command="%%PREFIX%%/bin/${name}" # read configuration and set defaults load_rc_config ${name} -: ${varnishlog_enable="NO"} -: ${varnishlog_file="/var/log/varnish.log"} -: ${varnishlog_flags="-P ${pidfile} -D -a -w ${varnishlog_file}"} - -load_rc_config ${name} +: ${varnishlog_enable:="NO"} +: ${varnishlog_pidfile:="/var/run/${name}.pid"} +: ${varnishlog_file:="/var/log/varnish.log"} +: ${varnishlog_flags:="-P ${varnishlog_pidfile} -D -a -w ${varnishlog_file}"} +pidfile=${varnishlog_pidfile} run_rc_command "$1" diff --git a/www/varnish2/files/varnishncsa.in b/www/varnish2/files/varnishncsa.in index 46b113f50e4c..75a6d2449a88 100644 --- a/www/varnish2/files/varnishncsa.in +++ b/www/varnish2/files/varnishncsa.in @@ -8,32 +8,42 @@ # KEYWORD: shutdown # -# Add the following lines to /etc/rc.conf to enable varnishncsa: +# Add the following line to /etc/rc.conf to enable varnishncsa: # -#varnishncsa_enable="YES" +# varnishncsa_enable="YES" # # Configuration variables and their default values: # -#varnishncsa_file=${varnishncsa_file:-"/var/log/varnish-ncsa.log"} -#varnishncsa_flags=${varnishncsa_flags:-"-D -P ${pidfile} -a -w ${varnishncsa_file}"} +# varnishncsa_pidfile - full path to the PID file. +# default: "/var/run/varnishncsa.pid" +# +# varnishncsa_file - full path to the log file. +# default: "/var/log/varnishncsa.log" +# +# varnishncsa_flags - command line arguments. +# default: "-D -P ${varnishncsa_pidfile} -a -c -w ${varnishncsa_file}" +# +# Add the following line to /etc/newsyslog.conf to rotate the log file +# once a day: +# +# /var/log/varnishncsa.log 640 7 * @T00 JB /var/run/varnishncsa.pid # # See varnishncsa(1) for a detailed overview of command-line options. # . %%RC_SUBR%% -name=varnishncsa +name="varnishncsa" rcvar=`set_rcvar` -command="%%PREFIX%%/bin/varnishncsa" -pidfile="/var/run/${name}.pid" +command="%%PREFIX%%/bin/${name}" # read configuration and set defaults load_rc_config ${name} -: ${varnishncsa_enable="NO"} -: ${varnishncsa_file="/var/log/varnish-ncsa.log"} -: ${varnishncsa_flags="-P ${pidfile} -D -a -w ${varnishncsa_file}"} - -load_rc_config ${name} +: ${varnishncsa_enable:="NO"} +: ${varnishncsa_pidfile:="/var/run/${name}.pid"} +: ${varnishncsa_file:="/var/log/${name}.log"} +: ${varnishncsa_flags:="-P ${varnishncsa_pidfile} -D -a -c -w ${varnishncsa_file}"} +pidfile=${varnishncsa_pidfile} run_rc_command "$1" |