Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 May 2015 14:34:43 +0000 (UTC)
From:      Mark Felder <feld@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r387610 - in head/www/varnish4: . files
Message-ID:  <201505271434.t4REYhuZ026543@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: feld
Date: Wed May 27 14:34:42 2015
New Revision: 387610
URL: https://svnweb.freebsd.org/changeset/ports/387610

Log:
  Add varnishd_extra_flags option to permit passing additional flags to
  varnishd
  
  Clean up rc scripts per rclint recommendations
  
  Differential Revision:	https://reviews.freebsd.org/D2605

Modified:
  head/www/varnish4/Makefile
  head/www/varnish4/files/varnishd.in
  head/www/varnish4/files/varnishlog.in
  head/www/varnish4/files/varnishncsa.in

Modified: head/www/varnish4/Makefile
==============================================================================
--- head/www/varnish4/Makefile	Wed May 27 14:31:01 2015	(r387609)
+++ head/www/varnish4/Makefile	Wed May 27 14:34:42 2015	(r387610)
@@ -2,7 +2,7 @@
 
 PORTNAME=	varnish
 PORTVERSION=	4.0.3
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	www
 MASTER_SITES=	http://repo.varnish-cache.org/source/
 PKGNAMESUFFIX=	4

Modified: head/www/varnish4/files/varnishd.in
==============================================================================
--- head/www/varnish4/files/varnishd.in	Wed May 27 14:31:01 2015	(r387609)
+++ head/www/varnish4/files/varnishd.in	Wed May 27 14:34:42 2015	(r387610)
@@ -52,26 +52,28 @@
 
 . /etc/rc.subr
 
-name="varnishd"
+name=varnishd
 rcvar=varnishd_enable
 
+load_rc_config ${name}
+
+: ${varnishd_enable:=NO}
+: ${varnishd_pidfile=/var/run/${name}.pid}
+: ${varnishd_listen=:80}
+: ${varnishd_admin=localhost:81}
+: ${varnishd_backend=localhost:8080}
+: ${varnishd_storage=file,/tmp,100M}
+: ${varnishd_hash=classic,16383}
+: ${varnishd_user=www}
+: ${varnishd_group=www}
+
 command="%%PREFIX%%/sbin/${name}"
+pidfile="${varnishd_pidfile}"
 
-# read configuration and set defaults
-load_rc_config ${name}
-: ${varnishd_enable:="NO"}
-: ${varnishd_pidfile:="/var/run/${name}.pid"}
-: ${varnishd_listen:=":80"}
-: ${varnishd_admin:="localhost:81"}
-: ${varnishd_backend:="localhost:8080"}
-: ${varnishd_storage:="file,/tmp,100M"}
-: ${varnishd_hash:="classic,16383"}
-: ${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} -h ${varnishd_hash} -u ${varnishd_user} -g ${varnishd_group}"}
+	: ${varnishd_flags:="-P ${varnishd_pidfile} -a ${varnishd_listen} -T ${varnishd_admin} -f ${varnishd_config} -s ${varnishd_storage} -h ${varnishd_hash} -u ${varnishd_user} -g ${varnishd_group} ${varnishd_extra_flags}"}
 else
-	: ${varnishd_flags:="-P ${varnishd_pidfile} -a ${varnishd_listen} -T ${varnishd_admin} -b ${varnishd_backend} -s ${varnishd_storage} -h ${varnishd_hash} -u ${varnishd_user} -g ${varnishd_group}"}
+	: ${varnishd_flags:="-P ${varnishd_pidfile} -a ${varnishd_listen} -T ${varnishd_admin} -b ${varnishd_backend} -s ${varnishd_storage} -h ${varnishd_hash} -u ${varnishd_user} -g ${varnishd_group} ${varnishd_extra_flags}"}
 fi
 
 # If we leave these set, rc.subr will su to them before starting
@@ -79,5 +81,4 @@ fi
 unset varnishd_user
 unset varnishd_group
 
-pidfile="${varnishd_pidfile}"
 run_rc_command "$1"

Modified: head/www/varnish4/files/varnishlog.in
==============================================================================
--- head/www/varnish4/files/varnishlog.in	Wed May 27 14:31:01 2015	(r387609)
+++ head/www/varnish4/files/varnishlog.in	Wed May 27 14:34:42 2015	(r387610)
@@ -33,17 +33,16 @@
 
 . /etc/rc.subr
 
-name="varnishlog"
+name=varnishlog
 rcvar=varnishlog_enable
 
-command="%%PREFIX%%/bin/${name}"
-
-# read configuration and set defaults
 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}"}
+: ${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}"}
 
+command="%%PREFIX%%/bin/${name}"
 pidfile=${varnishlog_pidfile}
+
 run_rc_command "$1"

Modified: head/www/varnish4/files/varnishncsa.in
==============================================================================
--- head/www/varnish4/files/varnishncsa.in	Wed May 27 14:31:01 2015	(r387609)
+++ head/www/varnish4/files/varnishncsa.in	Wed May 27 14:34:42 2015	(r387610)
@@ -37,18 +37,17 @@
 
 . /etc/rc.subr
 
-name="varnishncsa"
+name=varnishncsa
 rcvar=varnishncsa_enable
 
-command="%%PREFIX%%/bin/${name}"
-
-# read configuration and set defaults
 load_rc_config ${name}
-: ${varnishncsa_enable:="NO"}
-: ${varnishncsa_pidfile:="/var/run/${name}.pid"}
-: ${varnishncsa_file:="/var/log/${name}.log"}
-: ${varnishncsa_logformat:=""}
-: ${varnishncsa_flags:="-P ${varnishncsa_pidfile} -D -a -c -w ${varnishncsa_file}${varnishncsa_logformat:+ -F \"$varnishncsa_logformat\"}"}
 
+: ${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}${varnishncsa_logformat:+ -F \"$varnishncsa_logformat\"}"}
+
+command="%%PREFIX%%/bin/${name}"
 pidfile=${varnishncsa_pidfile}
+
 run_rc_command "$1"



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