From owner-freebsd-rc@FreeBSD.ORG Mon Nov 5 11:07:04 2007 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 DF22F16A4C4 for ; Mon, 5 Nov 2007 11:07:04 +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 C4F7413C4A6 for ; Mon, 5 Nov 2007 11:07:04 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id lA5B74AO026422 for ; Mon, 5 Nov 2007 11:07:04 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id lA5B74MK026418 for freebsd-rc@FreeBSD.org; Mon, 5 Nov 2007 11:07:04 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 5 Nov 2007 11:07:04 GMT Message-Id: <200711051107.lA5B74MK026418@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, 05 Nov 2007 11:07:05 -0000 Current FreeBSD problem reports Critical problems Serious problems S Tracker Resp. Description -------------------------------------------------------------------------------- o conf/98758 rc [jail] [patch] Templatize 'jail_fstab' in /etc/rc.d/ja o conf/98846 rc [jail] [patch] Templatize 'jail_rootdir' in /etc/rc.d/ o conf/105689 rc syslogd starts too late at boot o conf/107155 rc [ppp] /etc/rc.d/ppp-user does not bring up pppoe at bo o conf/107364 rc pf fails to start on bootup after system update from F 5 problems total. Non-critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- o conf/45226 rc [patch] Fix for rc.network, ppp-user annoyance o conf/48870 rc [PATCH] rc.network: allow to cancel interface status d o conf/58939 rc [patch] dumb little hack for /etc/rc.firewall{,6} o conf/73677 rc [patch] add support for powernow states to power_profi o conf/74817 rc [patch] network.subr: fixed automatic configuration of o conf/77663 rc Suggestion: add /etc/rc.d/addnetswap after addcritremo o conf/79196 rc [PATCH] configurable dummynet loading from /etc/rc.co o kern/81006 rc ipnat not working with tunnel interfaces on startup o conf/85363 rc syntax error in /etc/rc.d/devfs o conf/85819 rc [patch] script allowing multiuser mode in spite of fsc o conf/88913 rc [patch] wrapper support for rc.subr o conf/89061 rc [patch] IPv6 6to4 auto-configuration enhancement o conf/89870 rc [patch] feature request to make netif verbose rc.conf o conf/92523 rc [patch] allow rc scripts to kill process after a timeo o conf/93815 rc [patch] Adds in the ability to save ipfw rules to rc.d o conf/95162 rc [patch] Missing feature in rc.subr o conf/96343 rc [patch] rc.d order change to start inet6 before pf o conf/99444 rc [patch] Enhancement: rc.subr could easily support star o conf/99721 rc [patch] /etc/rc.initdiskless problem copy dotfile in s o conf/102700 rc [geli] [patch] Add encrypted /tmp support to GELI/GBDE o conf/102913 rc [jail] [patch] /etc/rc.d/named killall in jailed OS o conf/103486 rc [rc.d] [jail] [patch] rc.d/jail: mount fstab after dev o conf/103489 rc [rc.d] [jail] [patch] named_chroot_autoupdate doesn't o conf/104549 rc [patch] rc.d/nfsd needs special _find_processes functi o conf/105145 rc [PATCH] add redial function to rc.d/ppp o conf/105568 rc [patch] Add more flexibility to rc.conf, to choose "_e o conf/106009 rc [patch] Fix pppoed startup script to process multiply o conf/109562 rc [rc.d] [patch] Make rc.d/devfs usable from command-lin o conf/109980 rc /etc/rc.d/netif restart doesn't destroy cloned_interfa o conf/114119 rc [jail] [patch] /etc/rc.d/jail improvements for network o conf/116177 rc rc.d/mdconfig2 script fail at -CURRENT 31 problems total. From owner-freebsd-rc@FreeBSD.ORG Mon Nov 5 22:16:43 2007 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 A1E6D16A469; Mon, 5 Nov 2007 22:16:43 +0000 (UTC) (envelope-from mtm@FreeBSD.Org) Received: from terra.mike.lan (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 1AC3213C4BF; Mon, 5 Nov 2007 22:16:41 +0000 (UTC) (envelope-from mtm@FreeBSD.Org) Received: by terra.mike.lan (Postfix, from userid 1000) id 9BA5067DF3; Tue, 6 Nov 2007 01:19:50 +0300 (EAT) From: Mike Makonnen To: Mike Makonnen In-Reply-To: <20070517131713.GE3228@rogue.navcom.lan> References: <20070329182906.GB38703@rogue.navcom.lan> <20070403231423.GA5244 1@lor.one-eyed-alien.net> <20070405154644.GB1844@rogue.navcom.lan> <2007040 5160251.GA68077@lor.one-eyed-alien.net> <20070517131713.GE3228@rogue.navcom.lan> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Tue, 06 Nov 2007 01:19:50 +0300 Message-Id: <1194301190.75993.3.camel@terra> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 FreeBSD GNOME Team Port Cc: freebsd-net@freebsd.org, freebsd-rc@freebsd.org Subject: Re: Merging rc.d/network_ipv6 into rc.d/netif X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: mtm@FreeBSD.Org 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, 05 Nov 2007 22:16:43 -0000 Hello folks, I'd really like to get this done soon. I've been using it locally and I think it's ready for wider testing. The patch is at: http://people.freebsd.org/~mtm/src-etc.ipv6.diff I'll quickly summarize the changes, but there's a longer explanation attached to the patch. The main goal of this patch is to remove the special-casing of IPv6 configuration in rc.d. As we get closer and closer to transitioning to IPv6, there is no reason that IPv6 configuration should continue to be a special case (with regards to rc.d atleast). So, this is an attempt to normalize IPv4 and IPv6 network interface configuration and combine them both in rc.d/netif. Read on for a short summary of the user-visible changes: The following knobs no longer exist: network_interfaces ipv6_network_interfaces They have been replaced by the NOIPV4 and NOIPV6 keywords, respectively. Use of these knobs will trigger a warning. The following knobs have changed meaning: ifconfig_ ifconfig_DEFAULT You should no longer put IP related ifconfig(8) commands here. Instead they go in the respective ipvX_ prefixed knobs. Using these knobs for passing IP related configuration to ifconfig(8) will trigger a warning. To pass IP related configuration use instead: ipv4_ifconfig_ ipv6_ifconfig_ ipv4_ifconfig_DEFAULT ipv6_ifconfig_DEFAULT New knobs: ipv4_enable - Same deal as ipv6_enable except it works with IPv4 ipv4_synchronous_dhclient - see explanation in patch ipv6_synchronous_dhclient - see explanation in patch Most IP related knobs will have an ipv4_ and ipv6_ version. To make the transition easier rc.subr(8) will "automagically" DTRT for the following knobs: gateway_enable => ipv4_gateway_enable router_enable => ipv4_router_enable router => ipv4_router router_flags => ipv4_router_flags defaultrouter => ipv4_defaultrouter static_routes => ipv4_static_routes static_routes_ => ipv4_static_routes_ route_ => ipv4_route_ dhclient_program => ipv4_dhclient_program dhclient_flags => ipv4_dhclient_flags dhclient_flags_ => ipv4_dhclient_flags_ background_dhclient_ => ipv4_background_dhclient_ Please try it and let me know what you think. Cheers. -- Mike Makonnen | GPG-KEY: http://people.freebsd.org/~mtm/mtm.asc mmakonnen @ gmail.com | AC7B 5672 2D11 F4D0 EBF8 5279 5359 2B82 7CD4 1F55 mtm @ FreeBSD.Org | FreeBSD - http://www.freebsd.org From owner-freebsd-rc@FreeBSD.ORG Mon Nov 5 23:14:34 2007 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 CE06A16A468 for ; Mon, 5 Nov 2007 23:14:34 +0000 (UTC) (envelope-from fbsdlists@gmail.com) Received: from rv-out-0910.google.com (rv-out-0910.google.com [209.85.198.186]) by mx1.freebsd.org (Postfix) with ESMTP id 96A5313C48A for ; Mon, 5 Nov 2007 23:14:34 +0000 (UTC) (envelope-from fbsdlists@gmail.com) Received: by rv-out-0910.google.com with SMTP id l15so1465867rvb for ; Mon, 05 Nov 2007 15:14:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=grmBgyE9EbX+RMWQKtCHMj00MN1CSF8jlbiNH3qlCts=; b=JufZaXL3LQy57IRS3l2W5ahgXJ/X463FKv9da4QyuEbhg+KIHFj41XcJN0I25j69EtuHPU8YPQzghxpYpsieRJ8wjzBVIbFqCEvr6YeJCGIbqGErX6OR9hc7Fa1beJ9yQNKtJy+P556LPgkBJQXnMCj65+Qj0EGmZQdKXnPywlM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=twU9/YuX6jpi1tROc+5qJULEh4PVdDqkrcU+GfXGhnZIrkNuw0BKwgbJHxTsbh9FvXIvNltPUcGq+TcQknvIsdKnozYhWv5Q2pgFL2kDKG9ggyfUw0rWRNou7DmhcRI9VwCP6qEc1OrKX7y99unoFOgcGetkpB+mxjstWcw5tPU= Received: by 10.141.15.19 with SMTP id s19mr2687459rvi.1194302770412; Mon, 05 Nov 2007 14:46:10 -0800 (PST) Received: by 10.141.142.18 with HTTP; Mon, 5 Nov 2007 14:46:10 -0800 (PST) Message-ID: <54db43990711051446y6399b822p6ba9dbb86b65771b@mail.gmail.com> Date: Mon, 5 Nov 2007 17:46:10 -0500 From: "Bob Johnson" To: mtm@freebsd.org In-Reply-To: <1194301190.75993.3.camel@terra> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20070329182906.GB38703@rogue.navcom.lan> <20070405154644.GB1844@rogue.navcom.lan> <20070517131713.GE3228@rogue.navcom.lan> <1194301190.75993.3.camel@terra> Cc: freebsd-net@freebsd.org, freebsd-rc@freebsd.org Subject: Re: Merging rc.d/network_ipv6 into rc.d/netif 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, 05 Nov 2007 23:14:34 -0000 On 11/5/07, Mike Makonnen wrote: > Most IP related knobs will have an ipv4_ and ipv6_ version. To make the > transition easier rc.subr(8) will "automagically" DTRT for the following > knobs: > gateway_enable => ipv4_gateway_enable > router_enable => ipv4_router_enable > router => ipv4_router > router_flags => ipv4_router_flags > defaultrouter => ipv4_defaultrouter > static_routes => ipv4_static_routes > static_routes_ => ipv4_static_routes_ > route_ => ipv4_route_ > dhclient_program => ipv4_dhclient_program > dhclient_flags => ipv4_dhclient_flags > dhclient_flags_ => ipv4_dhclient_flags_ > background_dhclient_ => ipv4_background_dhclient_ > > Please try it and let me know what you think. Personally, I'd prefer the new names be along the lines of ifconfig__ipv4, ifconfig__ipv6, defaultrouter_ipv4, defaultrouter_ipv6, dhclient_program_ipv4, dhclient_program_ipv6, etc. The alphabetical ordering of my rc.conf file will remain more sensible, at least to my mind. All the dhclient knobs would still be grouped together, etc. But separating rc.conf into an ipv4 section and an ipv6 section (which your names would do) is entirely reasonable, so I don't feel strongly about it. And your names would segregate network configuration knobs from all the other things found in rc.conf, which some might view as an advantage. And this would be a good time to change defaultrouter to default_router! - Bob From owner-freebsd-rc@FreeBSD.ORG Wed Nov 7 05:30:04 2007 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 643A916A417 for ; Wed, 7 Nov 2007 05:30:04 +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 537B913C4B9 for ; Wed, 7 Nov 2007 05:30:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id lA75U4Bx091818 for ; Wed, 7 Nov 2007 05:30:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id lA75U4Zi091815; Wed, 7 Nov 2007 05:30:04 GMT (envelope-from gnats) Date: Wed, 7 Nov 2007 05:30:04 GMT Message-Id: <200711070530.lA75U4Zi091815@freefall.freebsd.org> To: freebsd-rc@FreeBSD.org From: Ben Kelly Cc: Subject: Re: conf/116177: rc.d/mdconfig2 script fail at -CURRENT X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Ben Kelly 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, 07 Nov 2007 05:30:04 -0000 The following reply was made to PR conf/116177; it has been noted by GNATS. From: Ben Kelly To: bug-followup@FreeBSD.org, dindin@dindin.ru Cc: Subject: Re: conf/116177: rc.d/mdconfig2 script fail at -CURRENT Date: Wed, 07 Nov 2007 00:02:52 -0500 If you are going to patch /etc/rc.d/mdconfig2 I think you also need to update the mdconfig script as well. It has the same problem. --- /usr/src/etc/rc.d/mdconfig 2007-08-25 00:19:17.000000000 +0000 +++ /etc/rc.d/mdconfig 2007-11-04 16:42:24.000000000 +0000 @@ -119,7 +119,7 @@ sleep 2 fi fi - if mdconfig -l -u ${_md} >/dev/null 2>&1; then + if [ -n "`mdconfig -l -u ${_md}`" ]; then err 3 "${_md} already exists" fi echo "Creating ${_md} device (${_type})." From owner-freebsd-rc@FreeBSD.ORG Wed Nov 7 08:47:29 2007 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 2665A16A419 for ; Wed, 7 Nov 2007 08:47:29 +0000 (UTC) (envelope-from ccowart@rescomp.berkeley.edu) Received: from hal.rescomp.berkeley.edu (hal.Rescomp.Berkeley.EDU [169.229.70.150]) by mx1.freebsd.org (Postfix) with ESMTP id 13F2A13C4BD for ; Wed, 7 Nov 2007 08:47:28 +0000 (UTC) (envelope-from ccowart@rescomp.berkeley.edu) Received: by hal.rescomp.berkeley.edu (Postfix, from userid 1225) id E542A3C0481; Wed, 7 Nov 2007 00:28:37 -0800 (PST) Date: Wed, 7 Nov 2007 00:28:37 -0800 From: Christopher Cowart To: freebsd-rc@FreeBSD.org Message-ID: <20071107082837.GM65098@hal.rescomp.berkeley.edu> Mail-Followup-To: freebsd-rc@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+4tyMlGyR6ddaJz2" Content-Disposition: inline Organization: RSSP-IT, UC Berkeley User-Agent: Mutt/1.5.16 (2007-06-09) Cc: Subject: Multiple instances of a daemon 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, 07 Nov 2007 08:47:29 -0000 --+4tyMlGyR6ddaJz2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello, I want to be able to use the same rc script to start several instances of a daemon. When I've encountered this desire before, I've cp'd the script, given it a unique name, and carried on with my business. This is a but kludgy and makes updating scripts a manual task. Today, I realized the arpd port didn't provide an rc script, so I set out to write one. I also knew that I was going to be launching several different arpd's, so I wanted to figure out a better way to deal with this problem. I thought I'd be clever and use symlinks: rc.d $ ls -l arpd* -r-xr-xr-x 1 root wheel 486 Nov 7 00:01 arpd lrwxr-xr-x 1 root wheel 4 Nov 6 23:32 arpd_vlan665 -> arpd lrwxr-xr-x 1 root wheel 4 Nov 6 23:32 arpd_vlan679 -> arpd Then I wrote my rc script with `name=3D${0##*/}'. Everything was fantastic doing manual starts and stops. Then I tried rebooting... After a few boots, some debugging, and a lot of tracing through /etc/rc and /etc/rc.subr, I found the problem (or is it a feature?). run_rc_script() sources the script. All the talk about not sourcing the "current shell" anymore, and I foolishly assumed that meant something more like calling the script and less like sourcing it in a subshell. I would really find it convenient to use the symlink trick shown above, because it means a symlink-compatible rc-script can be updated by the port or mergemaster, and all the "copies" will "just work." I'd be willing to take the time to implement something, but I don't pretend=20 to know all the use cases or the motivation behind this design.=20 One approach could be that run_rc_script() throws the rc script name into a variable visible to the sourced script, say _rc_script_name.=20 Then name could be something like `${_rc_script_name:-${0##*/}}' or a less terse if/then. Is this a feature other people would like to see, or is it just me? --=20 Chris Cowart Lead Systems Administrator Network & Infrastructure Services, RSSP-IT UC Berkeley --+4tyMlGyR6ddaJz2 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iQIVAwUBRzF3NSPHEDszU3zYAQJfQQ/+LeYMACS5nAvkf+A4L5bxH6hn8U7tN5GY MczWkPNcrge/b15oIZun6Nko+b6tetH/ZcurWM/JtdY2ZrAMn+RX0KP3bgUq5dOQ gbl6crU4cThFP2Y3XrX3lHflXMtFqSYdWjctWrgrUdHyrYxZm2ObaAjmiqu+7+Bx pcYW5CNaUOWk+Ah8gwAVsIuOM1buICBExItIo47fqZTCDpI784eZnbLVbs/JCStn e+gDGFbVA7ygeTttsDTzmuchzLpBoJyiX9i1PI1vXiCHgylWs3rKFUsQ6wVbLCZT zpmYhLXwjkzuaI2LC/+hnW0n31czX6CbmId+sLv4iOqnH7jn1H6WmpvSNQKiT5SN rrWGmvkZSGQgcqi6K2JglOv6HHD6tAywgbLaKCbXXRg17GYxHVypmQy5IxP0UbOp Yj/KGGEYyIBHHGXvUGO6X4cmtCmuLUllEJl/drPIi4o76Y5koMPMuzwWARIGilKP EzofEQ7Eu8TL76/mAOTizzemki2CLpeKaiwB6yzSMRYZIgaLG4wtQXrSPgGTeLsj FVJfTR6BDh7/t2bLbK/4f2kwTNLaWejjsFRmRqGWiujK5RCb2d85Qk4OM6rbmEkt AzF0lYbhk5ELGUaAi1iICuUK666ngs4TK6UOcceA6hJ9UnpfpgNqoLmJbS4HXrwW Uz6TXdEVB3Q= =5ElB -----END PGP SIGNATURE----- --+4tyMlGyR6ddaJz2-- From owner-freebsd-rc@FreeBSD.ORG Wed Nov 7 13:58:48 2007 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 80B3516A41B for ; Wed, 7 Nov 2007 13:58:48 +0000 (UTC) (envelope-from wmoran@collaborativefusion.com) Received: from mx00.pub.collaborativefusion.com (mx00.pub.collaborativefusion.com [206.210.89.199]) by mx1.freebsd.org (Postfix) with ESMTP id 3AB9113C4A8 for ; Wed, 7 Nov 2007 13:58:48 +0000 (UTC) (envelope-from wmoran@collaborativefusion.com) Received: from vanquish.pitbpa0.priv.collaborativefusion.com (vanquish.pitbpa0.priv.collaborativefusion.com [192.168.2.61]) (SSL: TLSv1/SSLv3,256bits,AES256-SHA) by wingspan with esmtp; Wed, 07 Nov 2007 08:48:03 -0500 id 00056407.4731C213.00007A7C Date: Wed, 7 Nov 2007 08:48:03 -0500 From: Bill Moran To: Christopher Cowart Message-Id: <20071107084803.6a3564db.wmoran@collaborativefusion.com> In-Reply-To: <20071107082837.GM65098@hal.rescomp.berkeley.edu> References: <20071107082837.GM65098@hal.rescomp.berkeley.edu> Organization: Collaborative Fusion X-Mailer: Sylpheed 2.4.4 (GTK+ 2.10.14; i386-portbld-freebsd6.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-rc@FreeBSD.org Subject: Re: Multiple instances of a daemon 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, 07 Nov 2007 13:58:48 -0000 In response to Christopher Cowart : > Hello, > > I want to be able to use the same rc script to start several instances > of a daemon. When I've encountered this desire before, I've cp'd the > script, given it a unique name, and carried on with my business. This is > a but kludgy and makes updating scripts a manual task. > > Today, I realized the arpd port didn't provide an rc script, so I set > out to write one. I also knew that I was going to be launching several > different arpd's, so I wanted to figure out a better way to deal with > this problem. > > I thought I'd be clever and use symlinks: > rc.d $ ls -l arpd* > -r-xr-xr-x 1 root wheel 486 Nov 7 00:01 arpd > lrwxr-xr-x 1 root wheel 4 Nov 6 23:32 arpd_vlan665 -> arpd > lrwxr-xr-x 1 root wheel 4 Nov 6 23:32 arpd_vlan679 -> arpd > > Then I wrote my rc script with `name=${0##*/}'. Everything was fantastic > doing manual starts and stops. Then I tried rebooting... > > After a few boots, some debugging, and a lot of tracing through /etc/rc > and /etc/rc.subr, I found the problem (or is it a feature?). > run_rc_script() sources the script. All the talk about not sourcing the > "current shell" anymore, and I foolishly assumed that meant something > more like calling the script and less like sourcing it in a subshell. > > I would really find it convenient to use the symlink trick shown above, > because it means a symlink-compatible rc-script can be updated by the > port or mergemaster, and all the "copies" will "just work." I'd be > willing to take the time to implement something, but I don't pretend > to know all the use cases or the motivation behind this design. > > One approach could be that run_rc_script() throws the rc script name > into a variable visible to the sourced script, say _rc_script_name. > Then name could be something like `${_rc_script_name:-${0##*/}}' or a > less terse if/then. > > Is this a feature other people would like to see, or is it just me? The canonical way of doing this has been a "profiles"-enabled rc script. See the Apache or Slony rc scripts for examples. Not sure if your approach might be better. -- Bill Moran Collaborative Fusion Inc. http://people.collaborativefusion.com/~wmoran/ wmoran@collaborativefusion.com Phone: 412-422-3463x4023 From owner-freebsd-rc@FreeBSD.ORG Wed Nov 7 21:17:10 2007 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 306EB16A418 for ; Wed, 7 Nov 2007 21:17:10 +0000 (UTC) (envelope-from ccowart@rescomp.berkeley.edu) Received: from hal.rescomp.berkeley.edu (hal.Rescomp.Berkeley.EDU [169.229.70.150]) by mx1.freebsd.org (Postfix) with ESMTP id 1383113C4B6 for ; Wed, 7 Nov 2007 21:17:09 +0000 (UTC) (envelope-from ccowart@rescomp.berkeley.edu) Received: by hal.rescomp.berkeley.edu (Postfix, from userid 1225) id F26FF3C048E; Wed, 7 Nov 2007 13:17:01 -0800 (PST) Date: Wed, 7 Nov 2007 13:17:01 -0800 From: Christopher Cowart To: freebsd-rc@freebsd.org Message-ID: <20071107211701.GP65098@hal.rescomp.berkeley.edu> Mail-Followup-To: freebsd-rc@freebsd.org References: <20071107082837.GM65098@hal.rescomp.berkeley.edu> <20071107084803.6a3564db.wmoran@collaborativefusion.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Pr8rMdbFBWzrOzFq" Content-Disposition: inline In-Reply-To: <20071107084803.6a3564db.wmoran@collaborativefusion.com> Organization: RSSP-IT, UC Berkeley User-Agent: Mutt/1.5.16 (2007-06-09) Subject: Re: Multiple instances of a daemon 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, 07 Nov 2007 21:17:10 -0000 --Pr8rMdbFBWzrOzFq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 07, 2007 at 08:48:03AM -0500, Bill Moran wrote: >In response to Christopher Cowart : >> Hello, >>=20 >> I want to be able to use the same rc script to start several instances >> of a daemon. When I've encountered this desire before, I've cp'd the >> script, given it a unique name, and carried on with my business. This is >> a but kludgy and makes updating scripts a manual task. >>=20 >> Today, I realized the arpd port didn't provide an rc script, so I set >> out to write one. I also knew that I was going to be launching several >> different arpd's, so I wanted to figure out a better way to deal with >> this problem. >>=20 >> I thought I'd be clever and use symlinks: >> rc.d $ ls -l arpd* >> -r-xr-xr-x 1 root wheel 486 Nov 7 00:01 arpd >> lrwxr-xr-x 1 root wheel 4 Nov 6 23:32 arpd_vlan665 -> arpd >> lrwxr-xr-x 1 root wheel 4 Nov 6 23:32 arpd_vlan679 -> arpd >>=20 >> Then I wrote my rc script with `name=3D${0##*/}'. Everything was fantast= ic >> doing manual starts and stops. Then I tried rebooting... >>=20 >> After a few boots, some debugging, and a lot of tracing through /etc/rc >> and /etc/rc.subr, I found the problem (or is it a feature?). >> run_rc_script() sources the script. All the talk about not sourcing the >> "current shell" anymore, and I foolishly assumed that meant something >> more like calling the script and less like sourcing it in a subshell. >>=20 >> I would really find it convenient to use the symlink trick shown above, >> because it means a symlink-compatible rc-script can be updated by the >> port or mergemaster, and all the "copies" will "just work." I'd be >> willing to take the time to implement something, but I don't pretend=20 >> to know all the use cases or the motivation behind this design.=20 >>=20 >> One approach could be that run_rc_script() throws the rc script name >> into a variable visible to the sourced script, say _rc_script_name.=20 >> Then name could be something like `${_rc_script_name:-${0##*/}}' or a >> less terse if/then. >>=20 >> Is this a feature other people would like to see, or is it just me? > >The canonical way of doing this has been a "profiles"-enabled rc >script. See the Apache or Slony rc scripts for examples. > >Not sure if your approach might be better. The jail rc script takes a smilar approach. It seems like when somebody wants to "profile" their script, they have to write the logic from scratch (or copy, paste, and tweak). Would a better solution be to=20 provide some default notion of profiling in the rc.subr library so rc=20 scripts can take advantage of it by default?=20 --=20 Chris Cowart Lead Systems Administrator Network & Infrastructure Services, RSSP-IT UC Berkeley --Pr8rMdbFBWzrOzFq Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iQIVAwUBRzIrTSPHEDszU3zYAQJZxhAAviiFFa8kFZ40F3PA6ZK3exqukAoODvy0 RLkWGFiPj4YrLrtwoL4nuzy7depJ8HwGDd5DhmvtEiH5QgLg4dc0BChCGLseEolu r53Tc87Uyp+rLJfRCWKIyDO37gbORmajCNFHcOURVt1wbXQaSOydQ9pluNUSACi2 1BnZ/1yWXyH8bERyLc27eqMxJ7DmfvqrTC5pq93T+3TwaeUOODfc99HV+9ZxeXCt G0LMb97j7AKh0DtWs/YnTrTO3HxheRE95DYu72kDRFmcNJcyjl+U1dPptTDkVH6F 3vq1M5bfwAE6C7N2Eo3ZIbxyxuKbRqDolkVXEBHr211/OLZfG74TVvuQy4WLG4Z5 kTs2Ijk35dR6Fr8JPiULL22ynSnhvsfbB+tOlNiPWTatJOvBPQ386+DyWJY9Ch2V MyM/n/LiNzM2+ynyxQhUOEiYbOppd7V9wQbIvIBPB4V4bfiWyxM476lcOVuGIz6Z V6qWhVsnQ72jJqJeIPd9oATer0EYsfkzWp9HAc7DZweQQw1Fstb7yqDRNbQAhNxC LS5CpM4A9IoPQC6OVhltwh6tDObv5lF1gE1wbE4oWEwW+rKG04/jZaWdIvm5913U vkK0PvHj6Ycj2m6pjlnSce3MPoEMKCdsAYqI+0br0wDmLeN05FFS6gU8TZQ2g8s/ v6XlGDBiajU= =S3q8 -----END PGP SIGNATURE----- --Pr8rMdbFBWzrOzFq-- From owner-freebsd-rc@FreeBSD.ORG Wed Nov 7 21:23:44 2007 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 A825C16A417 for ; Wed, 7 Nov 2007 21:23:44 +0000 (UTC) (envelope-from wmoran@collaborativefusion.com) Received: from mx00.pub.collaborativefusion.com (mx00.pub.collaborativefusion.com [206.210.89.199]) by mx1.freebsd.org (Postfix) with ESMTP id 6F20413C49D for ; Wed, 7 Nov 2007 21:23:44 +0000 (UTC) (envelope-from wmoran@collaborativefusion.com) Received: from vanquish.pitbpa0.priv.collaborativefusion.com (vanquish.pitbpa0.priv.collaborativefusion.com [192.168.2.61]) (SSL: TLSv1/SSLv3,256bits,AES256-SHA) by wingspan with esmtp; Wed, 07 Nov 2007 16:23:38 -0500 id 0005642A.47322CDA.0000CE69 Date: Wed, 7 Nov 2007 16:23:37 -0500 From: Bill Moran To: Christopher Cowart Message-Id: <20071107162337.61418004.wmoran@collaborativefusion.com> In-Reply-To: <20071107211701.GP65098@hal.rescomp.berkeley.edu> References: <20071107082837.GM65098@hal.rescomp.berkeley.edu> <20071107084803.6a3564db.wmoran@collaborativefusion.com> <20071107211701.GP65098@hal.rescomp.berkeley.edu> Organization: Collaborative Fusion X-Mailer: Sylpheed 2.4.4 (GTK+ 2.10.14; i386-portbld-freebsd6.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-rc@freebsd.org Subject: Re: Multiple instances of a daemon 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, 07 Nov 2007 21:23:44 -0000 In response to Christopher Cowart : > On Wed, Nov 07, 2007 at 08:48:03AM -0500, Bill Moran wrote: > >In response to Christopher Cowart : > >> Hello, > >> > >> I want to be able to use the same rc script to start several instances > >> of a daemon. When I've encountered this desire before, I've cp'd the > >> script, given it a unique name, and carried on with my business. This is > >> a but kludgy and makes updating scripts a manual task. > >> > >> Today, I realized the arpd port didn't provide an rc script, so I set > >> out to write one. I also knew that I was going to be launching several > >> different arpd's, so I wanted to figure out a better way to deal with > >> this problem. > >> > >> I thought I'd be clever and use symlinks: > >> rc.d $ ls -l arpd* > >> -r-xr-xr-x 1 root wheel 486 Nov 7 00:01 arpd > >> lrwxr-xr-x 1 root wheel 4 Nov 6 23:32 arpd_vlan665 -> arpd > >> lrwxr-xr-x 1 root wheel 4 Nov 6 23:32 arpd_vlan679 -> arpd > >> > >> Then I wrote my rc script with `name=${0##*/}'. Everything was fantastic > >> doing manual starts and stops. Then I tried rebooting... > >> > >> After a few boots, some debugging, and a lot of tracing through /etc/rc > >> and /etc/rc.subr, I found the problem (or is it a feature?). > >> run_rc_script() sources the script. All the talk about not sourcing the > >> "current shell" anymore, and I foolishly assumed that meant something > >> more like calling the script and less like sourcing it in a subshell. > >> > >> I would really find it convenient to use the symlink trick shown above, > >> because it means a symlink-compatible rc-script can be updated by the > >> port or mergemaster, and all the "copies" will "just work." I'd be > >> willing to take the time to implement something, but I don't pretend > >> to know all the use cases or the motivation behind this design. > >> > >> One approach could be that run_rc_script() throws the rc script name > >> into a variable visible to the sourced script, say _rc_script_name. > >> Then name could be something like `${_rc_script_name:-${0##*/}}' or a > >> less terse if/then. > >> > >> Is this a feature other people would like to see, or is it just me? > > > >The canonical way of doing this has been a "profiles"-enabled rc > >script. See the Apache or Slony rc scripts for examples. > > > >Not sure if your approach might be better. > > The jail rc script takes a smilar approach. It seems like when somebody > wants to "profile" their script, they have to write the logic from > scratch (or copy, paste, and tweak). Would a better solution be to > provide some default notion of profiling in the rc.subr library so rc > scripts can take advantage of it by default? Code in one place is always better than code in multiple places. The challenge will be to come up with an API that is actually useable. -- Bill Moran Collaborative Fusion Inc. http://people.collaborativefusion.com/~wmoran/ wmoran@collaborativefusion.com Phone: 412-422-3463x4023 From owner-freebsd-rc@FreeBSD.ORG Fri Nov 9 04:43:21 2007 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 120F716A469; Fri, 9 Nov 2007 04:43:21 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id DD41A13C4AA; Fri, 9 Nov 2007 04:43:20 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (linimon@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id lA94hKDh091277; Fri, 9 Nov 2007 04:43:20 GMT (envelope-from linimon@freefall.freebsd.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id lA94hKP8091270; Fri, 9 Nov 2007 04:43:20 GMT (envelope-from linimon) Date: Fri, 9 Nov 2007 04:43:20 GMT Message-Id: <200711090443.lA94hKP8091270@freefall.freebsd.org> To: linimon@FreeBSD.org, freebsd-bugs@FreeBSD.org, freebsd-rc@FreeBSD.org From: linimon@FreeBSD.org Cc: Subject: Re: conf/117935: [patch] ppp fails to start at boot because of missing ldconfig initialization 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, 09 Nov 2007 04:43:21 -0000 Old Synopsis: ppp fails to start at boot because of missing ldconfig initialization New Synopsis: [patch] ppp fails to start at boot because of missing ldconfig initialization Responsible-Changed-From-To: freebsd-bugs->freebsd-rc Responsible-Changed-By: linimon Responsible-Changed-When: Fri Nov 9 04:43:02 UTC 2007 Responsible-Changed-Why: Over to maintainer(s). http://www.freebsd.org/cgi/query-pr.cgi?pr=117935