From owner-freebsd-rc@FreeBSD.ORG Mon Jun 27 11:07:10 2011 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B598106566B for ; Mon, 27 Jun 2011 11:07:10 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 4A2968FC17 for ; Mon, 27 Jun 2011 11:07:10 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p5RB7AfY071943 for ; Mon, 27 Jun 2011 11:07:10 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p5RB79fq071941 for freebsd-rc@FreeBSD.org; Mon, 27 Jun 2011 11:07:09 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 27 Jun 2011 11:07:09 GMT Message-Id: <201106271107.p5RB79fq071941@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-rc@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-rc@FreeBSD.org 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: Mon, 27 Jun 2011 11:07:10 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o conf/158127 rc [patch] remount_optional option in rc.initdiskless doe o conf/157687 rc [patch] /etc/rc.d/quota and quotaon args o conf/155006 rc [patch] named(8): /etc/rc.d/named might set wrong pid o conf/154554 rc [rc.d] [patch] statd and lockd fail to start o conf/153666 rc [rc.d][patch] mount filesystems from fstab over zfs da o conf/153200 rc post-boot /etc/rc.d/network_ipv6 start can miss neighb o conf/153123 rc [rc] [patch] add gsched rc file to automatically inser o conf/152784 rc services provide himself instead providing class of se o conf/150752 rc [rc.subr] [patch] be not needed to eval $_pidcmd on re o conf/150474 rc [patch] rc.d/accounting: Add ability to set location o o conf/149867 rc [PATCH] rc.d script to manage multiple FIBS (kern opti o conf/149831 rc [PATCH] add support to /etc/rc.d/jail for delegating Z o conf/148656 rc rc.firewall(8): {oip} and {iip} variables in rc.firewa o conf/147685 rc [rc.d] [patch] new feature for /etc/rc.d/fsck o conf/147444 rc [rc.d] [patch] /etc/rc.d/zfs stop not called on reboot o conf/146053 rc [patch] [request] shutdown of jails breaks inter-jail o conf/145445 rc [rc.d] error in /etc/rc.d/jail (bad logic) o conf/145440 rc [rc.d] [patch] add multiple fib support (setfib) in /e o conf/145399 rc [patch] rc.d scripts are unable to start/stop programs o conf/145344 rc [patch] Fix kitchen sink approach for rc.d scripts ins o conf/145009 rc [patch] rc.subr(8): rc.conf should allow mac label con o conf/144213 rc [rc.d] [patch] Disappearing zvols on reboot o conf/143637 rc [patch] ntpdate(8) support for ntp-servers supplied by o conf/143085 rc [patch] ftp-proxy(8) rc(8) with multiple instances o conf/143084 rc [jail] [patch]: fix rc.d/jail creating stray softlinks o conf/142973 rc [jail] [patch] Strange counter init value in jail rc o conf/142434 rc [patch] Add cpuset(1) support to rc.subr(8) o conf/142304 rc rc.conf(5): mdconfig and mdconfig2 rc.d scripts lack e o conf/141909 rc rc.subr(8): [patch] add rc.conf.d support to /usr/loca o conf/141907 rc [rc.d] Bug if mtu (maybe others?) is set as first argu o conf/141678 rc [patch] A minor enhancement to how /etc/rc.d/jail dete o conf/141275 rc [request] dhclient(8) rc script should print something o conf/140440 rc [patch] allow local command files in rc.{suspend,resum o conf/140261 rc [patch] Improve flexibility of mdconfig2 startup scrip o conf/138208 rc [rc.d] [patch] Making rc.firewall (workstation) IPv6 a o conf/137629 rc [rc.d] background_dhclient rc.conf option causing doub o conf/137470 rc [PATCH] /etc/rc.d/mdconfig2 : prioritize cli parameter o conf/137271 rc [rc.d] Cannot update /etc/host.conf when root filesyst o conf/136875 rc [request] _flags appending o conf/136624 rc [rc.d] sysctl variables for ipnat are not applied on b o conf/135338 rc [rc.d] pf startup order seems broken [regression] o conf/134918 rc [patch] rc.subr fails to detect perl daemons o conf/134660 rc [patch] rc-script for initializing ng_netflow+ng_ipfw o conf/134333 rc PPP configuration problem in the rc.d scripts in combi o conf/134006 rc [patch] Unload console screensaver kernel modules if s o conf/133987 rc [rc.d] defaultroute broken with DHCP in some cases o conf/133890 rc [patch] sshd(8): add multiple profiles to the rc.d scr o conf/132483 rc rc.subr(8) [patch] setfib(1) support for rc.subr o conf/132476 rc [rc.d] [patch] add support setfib(1) in rc.d/routing o conf/128299 rc [patch] /etc/rc.d/geli does not mount partitions using o bin/126562 rc rcorder(8) fails to run unrelated startup scripts when o conf/126392 rc [patch] rc.conf ifconfig_xx keywords cannot be escaped p bin/126324 rc [patch] rc.d/tmp: Prevent mounting /tmp in second tim o conf/124747 rc [patch] savecore can't create dump from encrypted swap o conf/124248 rc [jail] [patch] add support for nice value for rc.d/jai o conf/123734 rc [patch] Chipset VIA CX700 requires extra initializatio o conf/123222 rc [patch] Add rtprio(1)/idprio(1) support to rc.subr(8). o conf/122968 rc [rc.d] /etc/rc.d/addswap: md swapfile multiplication a o conf/122477 rc [patch] /etc/rc.d/mdconfig and mdconfig2 are ignoring o conf/122170 rc [patch] [request] New feature: notify admin via page o o kern/121566 rc [nfs] [request] [patch] ethernet iface should be broug o conf/120431 rc [patch] devfs.rules are not initialized under certain o conf/120406 rc [devd] [patch] Handle newly attached pcm devices (eg. o conf/119874 rc [patch] "/etc/rc.d/pf reload" fails if there are macro o conf/119076 rc [patch] [rc.d] /etc/rc.d/netif tries to remove alias a o bin/118325 rc [patch] [request] new periodic script to test statuses o conf/118255 rc savecore never finding kernel core dumps (rcorder prob o conf/117935 rc [patch] ppp fails to start at boot because of missing o conf/113915 rc [patch] ndis wireless driver fails to associate when i o conf/109980 rc /etc/rc.d/netif restart doesn't destroy cloned_interfa o conf/109562 rc [rc.d] [patch] [request] Make rc.d/devfs usable from c o conf/109272 rc [request] increase default rc shutdown timeout o conf/108589 rc rtsol(8) fails due to default ipfw rules o conf/106009 rc [ppp] [patch] [request] Fix pppoed startup script to p o conf/105689 rc [ppp] [request] syslogd starts too late at boot o conf/105568 rc [patch] [request] Add more flexibility to rc.conf, to o conf/105145 rc [ppp] [patch] [request] add redial function to rc.d/pp o conf/104549 rc [patch] rc.d/nfsd needs special _find_processes functi o conf/102700 rc [geli] [patch] Add encrypted /tmp support to GELI/GBDE o conf/99721 rc [patch] /etc/rc.initdiskless problem copy dotfile in s o conf/99444 rc [patch] Enhancement: rc.subr could easily support star o conf/96343 rc [patch] rc.d order change to start inet6 before pf o conf/93815 rc [patch] Adds in the ability to save ipfw rules to rc.d o conf/92523 rc [patch] allow rc scripts to kill process after a timeo o conf/89870 rc [patch] [request] make netif verbose rc.conf toggle o conf/89061 rc [patch] IPv6 6to4 auto-configuration enhancement o conf/88913 rc [patch] wrapper support for rc.subr o conf/85819 rc [patch] script allowing multiuser mode in spite of fsc o kern/81006 rc ipnat not working with tunnel interfaces on startup o conf/77663 rc Suggestion: add /etc/rc.d/addnetswap after addcritremo o conf/73677 rc [patch] add support for powernow states to power_profi o conf/58939 rc [patch] dumb little hack for /etc/rc.firewall{,6} o conf/56934 rc [patch] rc.firewall rules for natd expect an interface o conf/45226 rc [patch] Fix for rc.network, ppp-user annoyance o conf/44170 rc [patch] Add ability to run multiple pppoed(8) on start 95 problems total. From owner-freebsd-rc@FreeBSD.ORG Tue Jun 28 05:26:16 2011 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DC64106564A; Tue, 28 Jun 2011 05:26:16 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 0D8E58FC0C; Tue, 28 Jun 2011 05:26:16 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p5S5QFhb091081; Tue, 28 Jun 2011 05:26:15 GMT (envelope-from ae@freefall.freebsd.org) Received: (from ae@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p5S5QFPA091077; Tue, 28 Jun 2011 05:26:15 GMT (envelope-from ae) Date: Tue, 28 Jun 2011 05:26:15 GMT Message-Id: <201106280526.p5S5QFPA091077@freefall.freebsd.org> To: freebsd-rc@FreeBSD.org, ae@FreeBSD.org, freebsd-ipfw@FreeBSD.org, freebsd-rc@FreeBSD.org From: ae@FreeBSD.org Cc: Subject: Re: conf/123119: [patch] rc script for ipfw does not handle IPv6 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: Tue, 28 Jun 2011 05:26:16 -0000 Synopsis: [patch] rc script for ipfw does not handle IPv6 Responsible-Changed-From-To: freebsd-ipfw->freebsd-rc Responsible-Changed-By: ae Responsible-Changed-When: Tue Jun 28 05:21:43 UTC 2011 Responsible-Changed-Why: Reassign to freebsd-rc@. This functionality is already present in head/ and stable/8. But stable/7 does not support some needed features in rc.subr and in the kernel to merge this support. http://www.freebsd.org/cgi/query-pr.cgi?pr=123119 From owner-freebsd-rc@FreeBSD.ORG Tue Jun 28 05:26:16 2011 Return-Path: Delivered-To: freebsd-rc@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DC64106564A; Tue, 28 Jun 2011 05:26:16 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 0D8E58FC0C; Tue, 28 Jun 2011 05:26:16 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p5S5QFhb091081; Tue, 28 Jun 2011 05:26:15 GMT (envelope-from ae@freefall.freebsd.org) Received: (from ae@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p5S5QFPA091077; Tue, 28 Jun 2011 05:26:15 GMT (envelope-from ae) Date: Tue, 28 Jun 2011 05:26:15 GMT Message-Id: <201106280526.p5S5QFPA091077@freefall.freebsd.org> To: freebsd-rc@FreeBSD.org, ae@FreeBSD.org, freebsd-ipfw@FreeBSD.org, freebsd-rc@FreeBSD.org From: ae@FreeBSD.org Cc: Subject: Re: conf/123119: [patch] rc script for ipfw does not handle IPv6 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: Tue, 28 Jun 2011 05:26:16 -0000 Synopsis: [patch] rc script for ipfw does not handle IPv6 Responsible-Changed-From-To: freebsd-ipfw->freebsd-rc Responsible-Changed-By: ae Responsible-Changed-When: Tue Jun 28 05:21:43 UTC 2011 Responsible-Changed-Why: Reassign to freebsd-rc@. This functionality is already present in head/ and stable/8. But stable/7 does not support some needed features in rc.subr and in the kernel to merge this support. http://www.freebsd.org/cgi/query-pr.cgi?pr=123119 From owner-freebsd-rc@FreeBSD.ORG Tue Jun 28 14:28:03 2011 Return-Path: Delivered-To: freebsd-rc@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 063511065673; Tue, 28 Jun 2011 14:28:03 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id D2F968FC0A; Tue, 28 Jun 2011 14:28:02 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p5SES2pN024290; Tue, 28 Jun 2011 14:28:02 GMT (envelope-from pluknet@freefall.freebsd.org) Received: (from pluknet@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p5SES2dh024286; Tue, 28 Jun 2011 14:28:02 GMT (envelope-from pluknet) Date: Tue, 28 Jun 2011 14:28:02 GMT Message-Id: <201106281428.p5SES2dh024286@freefall.freebsd.org> To: d.banschikov@peterhost.ru, pluknet@FreeBSD.org, freebsd-rc@FreeBSD.org From: pluknet@FreeBSD.org Cc: Subject: Re: conf/157687: [patch] /etc/rc.d/quota and quotaon args 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: Tue, 28 Jun 2011 14:28:03 -0000 Synopsis: [patch] /etc/rc.d/quota and quotaon args State-Changed-From-To: open->patched State-Changed-By: pluknet State-Changed-When: Tue Jun 28 14:27:24 UTC 2011 State-Changed-Why: Thanks for reporting! Different version committed. http://www.freebsd.org/cgi/query-pr.cgi?pr=157687 From owner-freebsd-rc@FreeBSD.ORG Tue Jun 28 14:30:11 2011 Return-Path: Delivered-To: freebsd-rc@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 620D6106566B for ; Tue, 28 Jun 2011 14:30:11 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 52B9D8FC08 for ; Tue, 28 Jun 2011 14:30:11 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p5SEUBep024545 for ; Tue, 28 Jun 2011 14:30:11 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p5SEUBYH024540; Tue, 28 Jun 2011 14:30:11 GMT (envelope-from gnats) Date: Tue, 28 Jun 2011 14:30:11 GMT Message-Id: <201106281430.p5SEUBYH024540@freefall.freebsd.org> To: freebsd-rc@FreeBSD.org From: dfilter@FreeBSD.ORG (dfilter service) Cc: Subject: Re: conf/157687: commit references a PR X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: dfilter service 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: Tue, 28 Jun 2011 14:30:11 -0000 The following reply was made to PR conf/157687; it has been noted by GNATS. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: conf/157687: commit references a PR Date: Tue, 28 Jun 2011 14:26:48 +0000 (UTC) Author: pluknet Date: Tue Jun 28 14:26:34 2011 New Revision: 223644 URL: http://svn.freebsd.org/changeset/base/223644 Log: Run load_rc_config before stop_cmd definition, so that ${quotaoff_flags} is correctly expanded inside stop_cmd instead of getting nothing. PR: conf/157687 Reported by: Dmitry Banschikov MFC after: 1 week Modified: head/etc/rc.d/quota Modified: head/etc/rc.d/quota ============================================================================== --- head/etc/rc.d/quota Tue Jun 28 14:10:39 2011 (r223643) +++ head/etc/rc.d/quota Tue Jun 28 14:26:34 2011 (r223644) @@ -14,6 +14,7 @@ name="quota" rcvar=`set_rcvar` +load_rc_config $name start_cmd="quota_start" stop_cmd="/usr/sbin/quotaoff ${quotaoff_flags}" @@ -30,5 +31,4 @@ quota_start() echo ' done.' } -load_rc_config $name run_rc_command "$1" _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-freebsd-rc@FreeBSD.ORG Tue Jun 28 21:45:42 2011 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4777E1065673 for ; Tue, 28 Jun 2011 21:45:42 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id D9E268FC0C for ; Tue, 28 Jun 2011 21:45:41 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id 61603359385 for ; Tue, 28 Jun 2011 23:45:40 +0200 (CEST) Received: by turtle.stack.nl (Postfix, from userid 1677) id 596441740A; Tue, 28 Jun 2011 23:45:40 +0200 (CEST) Date: Tue, 28 Jun 2011 23:45:40 +0200 From: Jilles Tjoelker To: freebsd-rc@freebsd.org Message-ID: <20110628214540.GA6258@stack.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Order of items in rc.d scripts such as quota 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: Tue, 28 Jun 2011 21:45:42 -0000 This message is about a style issue of little relevance to correctness; however, consistency in this regard is useful. The conventional order of items in rc.d scripts appears to be * comments and keywords * source /etc/rc.subr and the like * set variables like name, rcvar, start_cmd, stop_cmd * define functions * load_rc_config $name * run_rc_command "$1" A problem occurs when the variables to be set need rc.conf information. In the case of start_cmd and stop_cmd this can always be avoided by having them call a function (which could be done but was not done in the recently fixed /etc/rc.d/quota, r223644, conf/157687), but this does not work for some other variables like command_args (e.g. in /etc/rc.d/ypxfrd). A nasty thing about this is that /etc/rc.conf variables work even before load_rc_config when the script is started from /etc/rc (initial boot and shutdown) but not when the script is started directly or via service(8). Variables from /etc/rc.conf.d or defaults work in neither case. It would be safer to place load_rc_config directly below the name and rcvar settings and any set_rcvar and set_rcvar_obsolete calls. This is in fact exactly what r223644 does for /etc/rc.d/quota so this change seems good even if it is somewhat different from many other rc.d scripts. -- Jilles Tjoelker From owner-freebsd-rc@FreeBSD.ORG Wed Jun 29 00:02:48 2011 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 0A0D0106566C for ; Wed, 29 Jun 2011 00:02:48 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 65-241-43-4.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id BBFE7160D4D; Wed, 29 Jun 2011 00:02:47 +0000 (UTC) Message-ID: <4E0A6BA7.3060400@FreeBSD.org> Date: Tue, 28 Jun 2011 17:02:47 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.18) Gecko/20110624 Thunderbird/3.1.11 MIME-Version: 1.0 To: Jilles Tjoelker References: <20110628214540.GA6258@stack.nl> In-Reply-To: <20110628214540.GA6258@stack.nl> X-Enigmail-Version: 1.1.2 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-rc@freebsd.org Subject: Re: Order of items in rc.d scripts such as quota 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: Wed, 29 Jun 2011 00:02:48 -0000 On 06/28/2011 14:45, Jilles Tjoelker wrote: > This message is about a style issue of little relevance to correctness; > however, consistency in this regard is useful. > > The conventional order of items in rc.d scripts appears to be > * comments and keywords > * source /etc/rc.subr and the like > * set variables like name, rcvar, start_cmd, stop_cmd > * define functions > * load_rc_config $name > * run_rc_command "$1" > > A problem occurs when the variables to be set need rc.conf information. > In the case of start_cmd and stop_cmd this can always be avoided by > having them call a function (which could be done but was not done in the > recently fixed /etc/rc.d/quota, r223644, conf/157687), but this does not > work for some other variables like command_args (e.g. in > /etc/rc.d/ypxfrd). > > A nasty thing about this is that /etc/rc.conf variables work even before > load_rc_config when the script is started from /etc/rc (initial boot and > shutdown) but not when the script is started directly or via service(8). > Variables from /etc/rc.conf.d or defaults work in neither case. > > It would be safer to place load_rc_config directly below the name and > rcvar settings and any set_rcvar and set_rcvar_obsolete calls. This is > in fact exactly what r223644 does for /etc/rc.d/quota so this change > seems good even if it is somewhat different from many other rc.d > scripts. I agree. It's long been necessary to move load_rc_config up in ports scripts, e.g., http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/rc-scripts.html The current ordering was adopted wholesale from the NetBSD import, and is fine for trivial scripts, but as you point out here it causes more problems than it solves for anything even moderately complex. I've struggled with it in rc.d/named many times in fact. Assuming no one objects, how do you plan to make the change? My preference is towards doing it en masse in HEAD prior to 9-release, and MFC'ing to RELENG_8 prior to 8.3. I'm willing to do what I can to help here, albeit with a currently small supply of 'tuits. Doug -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-freebsd-rc@FreeBSD.ORG Fri Jul 1 19:56:22 2011 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0611F1065677 for ; Fri, 1 Jul 2011 19:56:22 +0000 (UTC) (envelope-from jpaetzel@freebsd.org) Received: from out3.smtp.messagingengine.com (out3.smtp.messagingengine.com [66.111.4.27]) by mx1.freebsd.org (Postfix) with ESMTP id C7C7A8FC19 for ; Fri, 1 Jul 2011 19:56:21 +0000 (UTC) Received: from compute4.internal (compute4.nyi.mail.srv.osa [10.202.2.44]) by gateway1.messagingengine.com (Postfix) with ESMTP id B8F6720CD4 for ; Fri, 1 Jul 2011 15:16:12 -0400 (EDT) Received: from frontend1.messagingengine.com ([10.202.2.160]) by compute4.internal (MEProxy); Fri, 01 Jul 2011 15:16:12 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=message-id:date:from:mime-version:to:subject:content-type; s=smtpout; bh=pHSHKeKUT1zXwoILh/vRp8//Uq0=; b=j4uPN/Dnd6yyFUPlK4AYrrj7Aqx2zgETyl62Y0oiaVFw706XNJipl92woJHq5yd8zDkQTk04ZkypuVH0roZimaRVijda0CMUGTHqd1iR1dynSsO8w8QRtRs7rgxfzcu0cH4wksiKA8dees5Bry7O84mHhI4TiNG0IjVxG1I+hvo= X-Sasl-enc: FKVQ7v+OdHvzKBBhTm+YoRK9iiyvaOE+A2A7w/RMftFI 1309547772 Received: from [10.10.1.125] (74-34-17-154.dr01.rsmt.mn.frontiernet.net [74.34.17.154]) by mail.messagingengine.com (Postfix) with ESMTPSA id 0747F403ED0 for ; Fri, 1 Jul 2011 15:16:11 -0400 (EDT) Message-ID: <4E0E1CFA.1080904@freebsd.org> Date: Fri, 01 Jul 2011 14:16:10 -0500 From: Josh Paezel Organization: FreeBSD User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110430 Thunderbird/3.1.10 MIME-Version: 1.0 To: freebsd-rc@freebsd.org X-Enigmail-Version: 1.1.2 Content-Type: multipart/mixed; boundary="------------020709020807010009090108" Subject: Fwd: Commit approval requested 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: Fri, 01 Jul 2011 19:56:22 -0000 This is a multi-part message in MIME format. --------------020709020807010009090108 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 This patch is in production at an organization which uses both single and multiple pflog devices on a range of devices. (eg: it doesn't break current configurations) It allows multiple pflog devices as well as multiple ftp-proxy instances. The patch was submitted as a PR conf/158181 I've applied the patch to a HEAD svn co and regenerated the patch with svn diff from that. Proposed commit message: (obviously the reviewed by depends :) The ftp-proxy and pflogd daemons both allow for multiple instances to be run simultaneously. However, the rc scripts that control the startup of these daemons have no concept of multiple instances. ftp-proxy requires a seperate instance for each "type" of proxying that you would like to perform. For example, two instances are required to allow operation through NAT for a group of internal servers connecting out, and an external server connecting inbound using active-mode FTP. pf allows logging to different target pflog interfaces, for more granular logging of traffic. This requires multiple pflogd instances, one to read each pflog interface. Contributed by: Thomas Johnson Approved by: kib (mentor) Reviewed by: freebsd-rc@freebsd.org Sponsored by: Claimlynx, Inc. MFC: 1 week PR: conf/158181 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJODhz6AAoJEKFq1/n1feG27+gH/RVftmVHbrzO3m9oZw3t/yMX voyxygRmGUSJiLfJE7mhKcEyBiAx2CAYOYn9lPgT3ZVAaW+EozHjlnN3/tsEss1y DyvwmtPGnKCul1qNRy2N6vri/DmXNN0lpVjhyZno7AKFps3ExH7Dhlm5aku1j8Lq l4Dp9IzYjOW6XYnO6e/qzFMpSG0saG+DorEYU1kuxYBkN/D5kcYqBHnBAgxJJZZ2 H7K1j/3J82izwqj2gKeFjdLaeI8Fntvwsjt2bbvsFIPHCh/8rD4RC5yTKeO0dME/ uEQjsdG2BcMUYyOnJ6U8EyW/mjTkGiz+KWcVosj16njPSJ6lvap++62/wCZQKJE= =kcA5 -----END PGP SIGNATURE----- --------------020709020807010009090108 Content-Type: text/plain; name="pflog.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pflog.diff" Index: share/man/man5/rc.conf.5 =================================================================== --- share/man/man5/rc.conf.5 (revision 223711) +++ share/man/man5/rc.conf.5 (working copy) @@ -880,6 +880,33 @@ This variable contains additional flags passed to the .Xr pflogd 8 program. +.It Va pflog_instances +.Pq Vt str +If logging to more than one +.Xr pflog 4 +interface is desired, +.Va pflog_instances +is set to the list of +.Xr pflogd 8 +instances that should be started at system boot time. If +.Va pflog_instances +is set, for each whitespace-seperated +.Ar element +in the list, +.Ao Ar element Ac Ns Va _dev +and +.Ao Ar element Ac Ns Va _logfile +elements are assumed to exist. +.Ao Ar element Ac Ns Va _dev +must contain the +.Xr pflog 4 +interface to be watched by the named +.Xr pflogd 8 +instance. +.Ao Ar element Ac Ns Va _logfile +must contain the name of the logfile that will be used by the +.Xr pflogd 8 +instance. .It Va ftpproxy_enable .Pq Vt bool Set to @@ -898,6 +925,19 @@ This variable contains additional flags passed to the .Xr ftp-proxy 8 program. +.It Va ftpproxy_instances +.Pq Vt str +Empty by default. If multiple instances of +.Xr ftp-proxy 8 +are desired at boot time, +.Va ftpproxy_instances +should contain a whitespace-seperated list of instance names. For each +.Ar element +in the list, a variable named +.Ao Ar element Ac Ns Va _flags +should be defined, containing the command-line flags to be passed to the +.Xr ftp-proxy 8 +instance. .It Va pfsync_enable .Pq Vt bool Set to Index: etc/rc.d/pflog =================================================================== --- etc/rc.d/pflog (revision 223711) +++ etc/rc.d/pflog (working copy) @@ -24,25 +24,41 @@ { load_kld pflog || return 1 - # set pflog0 interface to up state - if ! ifconfig pflog0 up; then - warn 'could not bring up pflog0.' + # set pflog_dev interface to up state + if ! ifconfig $pflog_dev up; then + warn "could not bring up $pflog_dev." return 1 fi # prepare the command line for pflogd - rc_flags="-f $pflog_logfile $rc_flags" + rc_flags="-f $pflog_logfile -i $pflog_dev $rc_flags" # report we're ready to run pflogd return 0 } +pflog_poststart() { + # Allow child pflogd to settle + sleep 0.10 + # More elegant(?) method for getting a unique pid + if [ -f /var/run/pflogd.pid ]; then + mv /var/run/pflogd.pid $pidfile + else + warn "/var/run/pflogd.pid does not exist. Too fast." + fi +} + pflog_poststop() { - if ! ifconfig pflog0 down; then - warn 'could not bring down pflog0.' + if ! ifconfig $pflog_dev down; then + warn "could not bring down $pflog_dev." return 1 fi + + if [ "$pflog_instances" ] && [ -n "$pflog_instances" ]; then + rm $pidfile + fi + return 0 } @@ -53,4 +69,33 @@ } load_rc_config $name -run_rc_command "$1" + +# Check if spawning multiple pflogd +echo "Starting pflogd: $pflog_instances" +if [ "$pflog_instances" ] && [ -n "$pflog_instances" ]; then + start_postcmd="pflog_poststart" + # Interate through requested instances. + for i in $pflog_instances; do + # Set required variables + eval pflog_dev=\$pflog_${i}_dev + eval pflog_logfile=\$pflog_${i}_logfile + eval pflog_flags=\$pflog_${i}_flags + # Check that required vars have non-zero length, warn if not. + if [ -z $pflog_dev ]; then + warn "pflog_dev not set" + continue + fi + if [ -z $pflog_logfile ]; then + warn "pflog_logfile not set" + continue + fi + # pflogd sets a pidfile, but the name is hardcoded. Concoct a + # unique pidfile name. + pidfile="/var/run/pflogd.$i.pid" + run_rc_command "$1" + done +else + # Typical case, spawn single instance only. + pflog_dev=${pflog_dev:-"pflog0"} + run_rc_command "$1" +fi Index: etc/rc.d/ftp-proxy =================================================================== --- etc/rc.d/ftp-proxy (revision 223711) +++ etc/rc.d/ftp-proxy (working copy) @@ -14,4 +14,62 @@ command="/usr/sbin/ftp-proxy" load_rc_config $name -run_rc_command "$1" + +# +# manage_pid argument +# Create or remove a pidfile manually, for daemons that can't be bothered +# to do it themselves. Takes one argument, which is the argument provided +# to the rc script. The pidfile will be named /var/run/<$name>.pid, +# unless $pidfile is defined. +# +# The method used to determine the pid is rather hacky; grep ps output to +# find '$procname|$command', then grep for ${name}_flags. If at all +# possible, use another method if at all possible, to avoid that dirty- +# code feeling. +# +manage_pid() { + local search_string ps_pid + case $1 in + *start) + cmd_string=`basename ${procname:-${command}}` + eval flag_string=\"\$${name}_flags\" + # Determine the pid. + ps_pid=`ps ax -o pid= -o command= | grep $cmd_string | grep -e "$flag_string" | grep -v grep | awk '{ print $1 }'` + # Write the pidfile depending on $pidfile status. + echo $ps_pid > ${pidfile:-"/var/run/$name.pid"} + ;; + stop) + rm $pidfile + ;; + esac +} + +# Allow ftp-proxy to start up in two different ways. The typical behavior +# is to start up one instance of ftp-proxy by setting ftpproxy_enable and +# ftpproxy_flags. The alternate behavior allows multiple instances of ftp- +# proxy to be started, allowing different types of proxy behavior. To use the +# new behavior, a list of instances must be defined, and a list of flags for +# each instance. For example, if we want to start two instances of ftp-proxy, +# foo and bar, we would set the following vars. +# ftpproxy_enable="YES" +# ftpproxy_instances="foo bar" +# ftpproxy_foo="" +# ftpproxy_bar="" +# +# Starting more than one ftp-proxy? +if [ "$ftpproxy_instances" ] && [ -n "${ftpproxy_instances}" ]; then + # Iterate through instance list. + for i in $ftpproxy_instances; do + #eval ftpproxy_${i}_flags=\$ftpproxy_${i} + #eval name=ftpproxy_${i} + # Set flags for this instance. + eval ftpproxy_flags=\$ftpproxy_${i} + # Define a unique pid file name. + pidfile="/var/run/ftp-proxy.$i.pid" + run_rc_command "$1" + manage_pid $1 + done +else + # Traditional single-instance behavior + run_rc_command "$1" +fi --------------020709020807010009090108-- From owner-freebsd-rc@FreeBSD.ORG Fri Jul 1 20:55:31 2011 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56B23106564A; Fri, 1 Jul 2011 20:55:31 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id AC3338FC08; Fri, 1 Jul 2011 20:55:30 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id AF58B359363; Fri, 1 Jul 2011 22:55:29 +0200 (CEST) Received: by turtle.stack.nl (Postfix, from userid 1677) id A5480175FB; Fri, 1 Jul 2011 22:55:29 +0200 (CEST) Date: Fri, 1 Jul 2011 22:55:29 +0200 From: Jilles Tjoelker To: Josh Paezel Message-ID: <20110701205529.GA93981@stack.nl> References: <4E0E1CFA.1080904@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4E0E1CFA.1080904@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-rc@freebsd.org Subject: Re: Fwd: Commit approval requested 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: Fri, 01 Jul 2011 20:55:31 -0000 On Fri, Jul 01, 2011 at 02:16:10PM -0500, Josh Paezel wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > This patch is in production at an organization which uses both single > and multiple pflog devices on a range of devices. (eg: it doesn't break > current configurations) > It allows multiple pflog devices as well as multiple ftp-proxy instances. > The patch was submitted as a PR conf/158181 > I've applied the patch to a HEAD svn co and regenerated the patch with > svn diff from that. Comments are inline. Note that I have not tested the patch nor any proposed changes. > Proposed commit message: (obviously the reviewed by depends :) > The ftp-proxy and pflogd daemons both allow for multiple instances to be > run simultaneously. However, the rc scripts that control the startup of > these daemons have no concept of multiple instances. > ftp-proxy requires a seperate instance for each "type" of proxying that > you would like to perform. For example, two instances are required to > allow operation through NAT for a group of internal servers connecting > out, and an external server connecting inbound using active-mode FTP. > pf allows logging to different target pflog interfaces, for more > granular logging of traffic. This requires multiple pflogd instances, > one to read each pflog interface. > Contributed by: Thomas Johnson > Approved by: kib (mentor) > Reviewed by: freebsd-rc@freebsd.org > Sponsored by: Claimlynx, Inc. > MFC: 1 week > PR: conf/158181 > Index: share/man/man5/rc.conf.5 > =================================================================== > --- share/man/man5/rc.conf.5 (revision 223711) > +++ share/man/man5/rc.conf.5 (working copy) > @@ -880,6 +880,33 @@ > This variable contains additional flags passed to the > .Xr pflogd 8 > program. > +.It Va pflog_instances > +.Pq Vt str > +If logging to more than one > +.Xr pflog 4 > +interface is desired, > +.Va pflog_instances > +is set to the list of > +.Xr pflogd 8 > +instances that should be started at system boot time. If > +.Va pflog_instances > +is set, for each whitespace-seperated Spelling: whitespace-separated > +.Ar element > +in the list, > +.Ao Ar element Ac Ns Va _dev > +and > +.Ao Ar element Ac Ns Va _logfile > +elements are assumed to exist. > +.Ao Ar element Ac Ns Va _dev > +must contain the > +.Xr pflog 4 > +interface to be watched by the named > +.Xr pflogd 8 > +instance. > +.Ao Ar element Ac Ns Va _logfile > +must contain the name of the logfile that will be used by the > +.Xr pflogd 8 > +instance. > .It Va ftpproxy_enable > .Pq Vt bool > Set to > @@ -898,6 +925,19 @@ > This variable contains additional flags passed to the > .Xr ftp-proxy 8 > program. > +.It Va ftpproxy_instances > +.Pq Vt str > +Empty by default. If multiple instances of > +.Xr ftp-proxy 8 > +are desired at boot time, > +.Va ftpproxy_instances > +should contain a whitespace-seperated list of instance names. For each > +.Ar element > +in the list, a variable named > +.Ao Ar element Ac Ns Va _flags > +should be defined, containing the command-line flags to be passed to the > +.Xr ftp-proxy 8 > +instance. > .It Va pfsync_enable > .Pq Vt bool > Set to > Index: etc/rc.d/pflog > =================================================================== > --- etc/rc.d/pflog (revision 223711) > +++ etc/rc.d/pflog (working copy) > @@ -24,25 +24,41 @@ > { > load_kld pflog || return 1 > > - # set pflog0 interface to up state > - if ! ifconfig pflog0 up; then > - warn 'could not bring up pflog0.' > + # set pflog_dev interface to up state > + if ! ifconfig $pflog_dev up; then > + warn "could not bring up $pflog_dev." > return 1 > fi > > # prepare the command line for pflogd > - rc_flags="-f $pflog_logfile $rc_flags" > + rc_flags="-f $pflog_logfile -i $pflog_dev $rc_flags" > > # report we're ready to run pflogd > return 0 > } > > +pflog_poststart() { > + # Allow child pflogd to settle > + sleep 0.10 > + # More elegant(?) method for getting a unique pid > + if [ -f /var/run/pflogd.pid ]; then > + mv /var/run/pflogd.pid $pidfile > + else > + warn "/var/run/pflogd.pid does not exist. Too fast." > + fi > +} This renaming is rather ugly and should be replaced by a pidfile option in pflogd(8). However, the hack could be acceptable. The sleep also points at a sadly common error in daemonizing. IMHO the parent process should not exit until the pidfile is written, and ideally not until all initialization that can commonly fail is done. This saves a lot of grief when debugging problems. Note that this means that daemon(3) cannot be used. > + > pflog_poststop() > { > - if ! ifconfig pflog0 down; then > - warn 'could not bring down pflog0.' > + if ! ifconfig $pflog_dev down; then > + warn "could not bring down $pflog_dev." > return 1 > fi > + > + if [ "$pflog_instances" ] && [ -n "$pflog_instances" ]; then These two checks are equivalent. The convention in rc.d scripts is [ -n "$pflog_instances" ] This occurs a few more times. > + rm $pidfile > + fi > + > return 0 > } > > @@ -53,4 +69,33 @@ > } > > load_rc_config $name > -run_rc_command "$1" > + > +# Check if spawning multiple pflogd > +echo "Starting pflogd: $pflog_instances" > +if [ "$pflog_instances" ] && [ -n "$pflog_instances" ]; then > + start_postcmd="pflog_poststart" > + # Interate through requested instances. > + for i in $pflog_instances; do > + # Set required variables > + eval pflog_dev=\$pflog_${i}_dev > + eval pflog_logfile=\$pflog_${i}_logfile > + eval pflog_flags=\$pflog_${i}_flags > + # Check that required vars have non-zero length, warn if not. > + if [ -z $pflog_dev ]; then Quotes around $pflog_dev would be safer. > + warn "pflog_dev not set" > + continue > + fi > + if [ -z $pflog_logfile ]; then Quotes. > + warn "pflog_logfile not set" > + continue > + fi > + # pflogd sets a pidfile, but the name is hardcoded. Concoct a > + # unique pidfile name. > + pidfile="/var/run/pflogd.$i.pid" > + run_rc_command "$1" > + done > +else > + # Typical case, spawn single instance only. > + pflog_dev=${pflog_dev:-"pflog0"} > + run_rc_command "$1" > +fi Using run_rc_command "$1" multiple times also happens in etc/rc.d/sendmail so I guess it is ok. > Index: etc/rc.d/ftp-proxy > =================================================================== > --- etc/rc.d/ftp-proxy (revision 223711) > +++ etc/rc.d/ftp-proxy (working copy) > @@ -14,4 +14,62 @@ > command="/usr/sbin/ftp-proxy" > > load_rc_config $name > -run_rc_command "$1" > + > +# > +# manage_pid argument > +# Create or remove a pidfile manually, for daemons that can't be bothered > +# to do it themselves. Takes one argument, which is the argument provided > +# to the rc script. The pidfile will be named /var/run/<$name>.pid, > +# unless $pidfile is defined. > +# > +# The method used to determine the pid is rather hacky; grep ps output to > +# find '$procname|$command', then grep for ${name}_flags. If at all > +# possible, use another method if at all possible, to avoid that dirty- > +# code feeling. > +# > +manage_pid() { This function should be broken into a ftp_proxy_poststart and ftp_proxy_poststop and enabled via $start_postcmd and $stop_postcmd respectively. This is cleaner and ensures the pidfile is not messed with if something fails. > + local search_string ps_pid > + case $1 in > + *start) > + cmd_string=`basename ${procname:-${command}}` Consider cmd_string=${procname:-${command}} cmd_string=${cmd_string##*/} like rc.subr does, saving a fork. > + eval flag_string=\"\$${name}_flags\" > + # Determine the pid. > + ps_pid=`ps ax -o pid= -o command= | grep $cmd_string | grep -e "$flag_string" | grep -v grep | awk '{ print $1 }'` Would it be possible to replace this long pipeline with pgrep, like ps_pid=$(pgrep -f "$cmd_string.*$flag_string") to simplify and reduce forks? If not, move the functionality of the three greps into the awk. > + # Write the pidfile depending on $pidfile status. > + echo $ps_pid > ${pidfile:-"/var/run/$name.pid"} > + ;; > + stop) > + rm $pidfile > + ;; > + esac > +} > + > +# Allow ftp-proxy to start up in two different ways. The typical behavior > +# is to start up one instance of ftp-proxy by setting ftpproxy_enable and > +# ftpproxy_flags. The alternate behavior allows multiple instances of ftp- > +# proxy to be started, allowing different types of proxy behavior. To use the > +# new behavior, a list of instances must be defined, and a list of flags for > +# each instance. For example, if we want to start two instances of ftp-proxy, > +# foo and bar, we would set the following vars. > +# ftpproxy_enable="YES" > +# ftpproxy_instances="foo bar" > +# ftpproxy_foo="" > +# ftpproxy_bar="" > +# > +# Starting more than one ftp-proxy? > +if [ "$ftpproxy_instances" ] && [ -n "${ftpproxy_instances}" ]; then Redundant test, see above. > + # Iterate through instance list. > + for i in $ftpproxy_instances; do > + #eval ftpproxy_${i}_flags=\$ftpproxy_${i} > + #eval name=ftpproxy_${i} These comments do not belong here, I suppose? > + # Set flags for this instance. > + eval ftpproxy_flags=\$ftpproxy_${i} > + # Define a unique pid file name. > + pidfile="/var/run/ftp-proxy.$i.pid" > + run_rc_command "$1" > + manage_pid $1 > + done > +else > + # Traditional single-instance behavior > + run_rc_command "$1" > +fi -- Jilles Tjoelker From owner-freebsd-rc@FreeBSD.ORG Sat Jul 2 22:12:52 2011 Return-Path: Delivered-To: freebsd-rc@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B7631065670; Sat, 2 Jul 2011 22:12:52 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 6422B8FC1F; Sat, 2 Jul 2011 22:12:52 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p62MCqM4037224; Sat, 2 Jul 2011 22:12:52 GMT (envelope-from gavin@freefall.freebsd.org) Received: (from gavin@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p62MCqOE037220; Sat, 2 Jul 2011 22:12:52 GMT (envelope-from gavin) Date: Sat, 2 Jul 2011 22:12:52 GMT Message-Id: <201107022212.p62MCqOE037220@freefall.freebsd.org> To: gavin@FreeBSD.org, freebsd-bugs@FreeBSD.org, freebsd-rc@FreeBSD.org From: gavin@FreeBSD.org Cc: Subject: Re: conf/158557: [patch] /etc/rc.d/pf broken messages 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: Sat, 02 Jul 2011 22:12:52 -0000 Synopsis: [patch] /etc/rc.d/pf broken messages Responsible-Changed-From-To: freebsd-bugs->freebsd-rc Responsible-Changed-By: gavin Responsible-Changed-When: Sat Jul 2 22:12:22 UTC 2011 Responsible-Changed-Why: Over to maintainer(s) http://www.freebsd.org/cgi/query-pr.cgi?pr=158557