From owner-svn-src-stable@freebsd.org Thu Jan 28 00:41:08 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA5B8A6F44F; Thu, 28 Jan 2016 00:41:08 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 91C4015E2; Thu, 28 Jan 2016 00:41:08 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0S0f7H0057253; Thu, 28 Jan 2016 00:41:07 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0S0f7tl057252; Thu, 28 Jan 2016 00:41:07 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201601280041.u0S0f7tl057252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Thu, 28 Jan 2016 00:41:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r294964 - stable/10/etc/rc.d X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2016 00:41:08 -0000 Author: jamie Date: Thu Jan 28 00:41:07 2016 New Revision: 294964 URL: https://svnweb.freebsd.org/changeset/base/294964 Log: MFC r294749: Allow the (old rc-style) exec_afterstart jail parameters to start numbering at 0, like exec_prestart and the others do. Make param0 optional, i.e. still look for param1. PR: 142973 Modified: stable/10/etc/rc.d/jail Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/rc.d/jail ============================================================================== --- stable/10/etc/rc.d/jail Wed Jan 27 22:56:04 2016 (r294963) +++ stable/10/etc/rc.d/jail Thu Jan 28 00:41:07 2016 (r294964) @@ -32,7 +32,7 @@ need_dad_wait= # Extract value from ${jail_$jv_$name} or ${jail_$name} and # set it to $param. If not defined, $defval is used. # When $num is [0-9]*, ${jail_$jv_$name$num} are looked up and -# $param is set by using +=. +# $param is set by using +=. $num=0 is optional (params may start at 1). # When $num is YN or NY, the value is interpret as boolean. extract_var() { @@ -72,7 +72,7 @@ extract_var() eval _tmpargs=\"\${$_name1:-\${$_name2:-$_def}}\" if [ -n "$_tmpargs" ]; then echo " $_param += \"$_tmpargs\";" - else + elif [ $i != 0 ]; then break; fi i=$(($i + 1)) @@ -202,7 +202,7 @@ parse_options() extract_var $_jv exec_poststop exec.poststop 0 "" echo " exec.start += \"$_exec_start\";" - extract_var $_jv exec_afterstart exec.start 1 "" + extract_var $_jv exec_afterstart exec.start 0 "" echo " exec.stop = \"$_exec_stop\";" extract_var $_jv consolelog exec.consolelog - \