From owner-freebsd-rc@FreeBSD.ORG Sun Mar 4 06:35:31 2007 Return-Path: X-Original-To: freebsd-rc@freebsd.org Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3FEF716A401 for ; Sun, 4 Mar 2007 06:35:31 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx24.fluidhosting.com [204.14.89.7]) by mx1.freebsd.org (Postfix) with SMTP id D39B613C428 for ; Sun, 4 Mar 2007 06:35:30 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: (qmail 22903 invoked by uid 399); 4 Mar 2007 06:35:29 -0000 Received: from localhost (HELO lap.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with SMTP; 4 Mar 2007 06:35:29 -0000 X-Originating-IP: 127.0.0.1 Message-ID: <45EA68AF.6000700@FreeBSD.org> Date: Sat, 03 Mar 2007 22:35:27 -0800 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Thunderbird 2.0b2 (X11/20070116) MIME-Version: 1.0 To: Yar Tikhiy , freebsd-rc@freebsd.org References: <200703031011.l23ABYhb039755@repoman.freebsd.org> In-Reply-To: <200703031011.l23ABYhb039755@repoman.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: Re: cvs commit: doc/en_US.ISO8859-1/articles/rc-scripting article.sgml X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2007 06:35:31 -0000 Yar Tikhiy wrote: > yar 2007-03-03 10:11:34 UTC > > FreeBSD doc repository > > Modified files: > en_US.ISO8859-1/articles/rc-scripting article.sgml > Log: > Explain how an rc.d script can use extra command-line arguments. > > Revision Changes Path > 1.9 +138 -0 doc/en_US.ISO8859-1/articles/rc-scripting/article.sgml > > http://www.FreeBSD.org/cgi/cvsweb.cgi/doc/en_US.ISO8859-1/articles/rc-scripting/article.sgml.diff?&r1=1.8&r2=1.9&f=h Yar, This good stuff, thanks! I have one quibble with the last paragraph. The shift in rc.subr isn't "apparent" as you phrase it, it's literal: run_rc_command() { ... # Don't repeat the first argument when passing additional command- # line arguments to the command subroutines. # shift 1 rc_extra_args="$*" ... I would also put this information in the second paragraph, since as a first time reader of your piece I had the question very early on. I would say: limits). The first command line parameter (start|stop|etc.) will be shifted out by rc.subr, so what was $2 on the original command line will become $1, and so on. Therefore the changes in the script itself ... hth, Doug -- This .signature sanitized for your protection