From owner-freebsd-rc@FreeBSD.ORG Sun Aug 22 04:47:54 2010 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 1FBA710656A3; Sun, 22 Aug 2010 04:47:54 +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 EABE58FC0A; Sun, 22 Aug 2010 04:47:53 +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 o7M4lrnn029623; Sun, 22 Aug 2010 04:47:53 GMT (envelope-from linimon@freefall.freebsd.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o7M4lrqc029619; Sun, 22 Aug 2010 04:47:53 GMT (envelope-from linimon) Date: Sun, 22 Aug 2010 04:47:53 GMT Message-Id: <201008220447.o7M4lrqc029619@freefall.freebsd.org> To: linimon@FreeBSD.org, freebsd-bugs@FreeBSD.org, freebsd-rc@FreeBSD.org From: linimon@FreeBSD.org Cc: Subject: Re: conf/149867: [PATCH] rc.d script to manage multiple FIBS (kern options ROUTETABLES) from rc.conf 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, 22 Aug 2010 04:47:54 -0000 Synopsis: [PATCH] rc.d script to manage multiple FIBS (kern options ROUTETABLES) from rc.conf Responsible-Changed-From-To: freebsd-bugs->freebsd-rc Responsible-Changed-By: linimon Responsible-Changed-When: Sun Aug 22 04:47:16 UTC 2010 Responsible-Changed-Why: New script. Over to maintainer(s). http://www.freebsd.org/cgi/query-pr.cgi?pr=149867 From owner-freebsd-rc@FreeBSD.ORG Mon Aug 23 11:07:06 2010 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 C8C86106566C for ; Mon, 23 Aug 2010 11:07:06 +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 AC1BE8FC1B for ; Mon, 23 Aug 2010 11:07:06 +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 o7NB76DF089185 for ; Mon, 23 Aug 2010 11:07:06 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o7NB76re089183 for freebsd-rc@FreeBSD.org; Mon, 23 Aug 2010 11:07:06 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 23 Aug 2010 11:07:06 GMT Message-Id: <201008231107.o7NB76re089183@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, 23 Aug 2010 11:07:06 -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/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/148961 rc [PATCH] netstart and network_ipv6 contains references 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 conf/127917 rc [patch] dumpon rejects on start with physmem>swap even 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/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 86 problems total. From owner-freebsd-rc@FreeBSD.ORG Mon Aug 23 12:40:05 2010 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 D4C4E1065694 for ; Mon, 23 Aug 2010 12:40:05 +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 C39688FC13 for ; Mon, 23 Aug 2010 12:40:05 +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 o7NCe5rc083236 for ; Mon, 23 Aug 2010 12:40:05 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o7NCe5cO083235; Mon, 23 Aug 2010 12:40:05 GMT (envelope-from gnats) Date: Mon, 23 Aug 2010 12:40:05 GMT Message-Id: <201008231240.o7NCe5cO083235@freefall.freebsd.org> To: freebsd-rc@FreeBSD.org From: Kenneth Vestergaard Cc: Subject: Re: conf/149831: [PATCH] add support to /etc/rc.d/jail for delegating ZFS-filesystems to jails X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Kenneth Vestergaard 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, 23 Aug 2010 12:40:06 -0000 The following reply was made to PR conf/149831; it has been noted by GNATS. From: Kenneth Vestergaard To: bug-followup@FreeBSD.org, kvs@binarysolutions.dk Cc: Subject: Re: conf/149831: [PATCH] add support to /etc/rc.d/jail for delegating ZFS-filesystems to jails Date: Mon, 23 Aug 2010 14:34:32 +0200 --Apple-Mail-7--683005463 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Small update to fix a regression where output didn't go to = /var/log/jail_NAME_console.log any more. --Apple-Mail-7--683005463 Content-Disposition: attachment; filename=zfs-fix-delegated-paths-in-jail.diff.txt Content-Type: text/plain; x-unix-mode=0644; name="zfs-fix-delegated-paths-in-jail.diff.txt" Content-Transfer-Encoding: 7bit # $PIL$ Add a jail_NAME_delegate_path-variable to rc.conf, which'll delegate all jailed zfs's under that path to the newly-started jail. http://www.freebsd.org/cgi/query-pr.cgi?pr=149831 --- src/etc/rc.d/jail.orig 2010-08-19 12:39:01.000000000 +0200 +++ src/etc/rc.d/jail 2010-08-20 15:57:07.508674101 +0200 @@ -41,6 +41,7 @@ eval _ip=\"\$jail_${_j}_ip\" eval _interface=\"\${jail_${_j}_interface:-${jail_interface}}\" eval _exec=\"\$jail_${_j}_exec\" + eval _delegate_path=\"\$jail_${_j}_delegate_path\" i=0 while : ; do @@ -132,6 +133,7 @@ debug "$_j procdir: $_procdir" debug "$_j ruleset: $_ruleset" debug "$_j fstab: $_fstab" + debug "$_j delegate_path: $_delegate_path" i=0 while : ; do @@ -635,8 +637,23 @@ i=$((i + 1)) done - eval ${_setfib} jail ${_flags} -i ${_rootdir} ${_hostname} \ - \"${_addrl}\" ${_exec_start} > ${_tmp_jail} 2>&1 + # create jail with 'persist', so we can get a jid before starting it, + # which is needed if we need to delegate any zfs-filesystems to it. + jail -i -c name=${_jail} path=${_rootdir} persist > ${_tmp_jail} 2>&1 + _jail_id=$(head -1 ${_tmp_jail}) + echo started jail ${_jail} with id ${_jail_id} + + if [ ! -z "${_delegate_path}" ] ; then + jail -m jid=${_jail_id} allow.mount=1 + /sbin/zfs get -s local -rH -o name,value jailed ${_delegate_path} | \ + /usr/bin/awk '$2 == "on" { print $1 }' | \ + /usr/bin/xargs -I % /sbin/zfs jail ${_jail_id} % + fi + + eval ${_setfib} jail ${_flags} -m \ + jid=${_jail_id} \ + host.hostname=${_hostname} \ + ip4.addr=\"${_addrl}\" command=${_exec_start} >> ${_tmp_jail} 2>&1 if [ "$?" -eq 0 ] ; then _jail_id=$(head -1 ${_tmp_jail}) @@ -669,6 +686,7 @@ echo " cannot start jail \"${_jail}\": " tail +2 ${_tmp_jail} fi + jail -m jid=${_jail_id} nopersist # remove 'persist' set at create-time rm -f ${_tmp_jail} done rmdir ${_tmp_dir} --Apple-Mail-7--683005463-- From owner-freebsd-rc@FreeBSD.ORG Thu Aug 26 20:17:20 2010 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 B78501065694 for ; Thu, 26 Aug 2010 20:17:20 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com [209.85.216.175]) by mx1.freebsd.org (Postfix) with ESMTP id 6993E8FC15 for ; Thu, 26 Aug 2010 20:17:20 +0000 (UTC) Received: by qyk8 with SMTP id 8so7148076qyk.13 for ; Thu, 26 Aug 2010 13:17:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:cc:content-type; bh=43874TbKjj9uAt5/UKsK7RYq724oxkYCIaaSOB59+0w=; b=GvhjPOR16bwekihw15DpsGeB5xxn7wBaUiBGNVKk+rtj96NLkeDBMiYXGFO1ObY5lG f8ZRMkSOii+kNTXJ3n8qR/COZCH91bKwzXpKjW2nHMMEwVHtJqwvvq7vjZA5trEXlL1A D4DGJLt/FeWZDEqVEgZ0RFarKQi2Fa1afOBnM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; b=f+dK/v20tLhf+ZWQRtVD0oaQ4Xfjlppe3f5cSpc/q88A41O6Hxkt/2iVs1iA1PwNud eWYXyPRsGFOzXjSn+mgI/fOWfjKyru74Nt2UEtMahXrrG11OwtAhPdZFRlLoxHlYeyXF lq21hNNYDrzK3GiJ5f7RoLb5W2jFKtcxxaoSQ= MIME-Version: 1.0 Received: by 10.229.181.8 with SMTP id bw8mr7514151qcb.113.1282852424516; Thu, 26 Aug 2010 12:53:44 -0700 (PDT) Received: by 10.229.26.81 with HTTP; Thu, 26 Aug 2010 12:53:44 -0700 (PDT) Date: Thu, 26 Aug 2010 23:53:44 +0400 Message-ID: From: pluknet To: freebsd-rc@freebsd.org Content-Type: multipart/mixed; boundary=0016361e81a810124b048ebf5b14 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: FreeBSD Current Subject: [RFC] ifconfig description support in rc.d 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: Thu, 26 Aug 2010 20:17:20 -0000 --0016361e81a810124b048ebf5b14 Content-Type: text/plain; charset=ISO-8859-1 [cc'ing current@ as rc@ looks too quite] Hi. Since ifconfig has grown to label interfaces with ifconfig $ifname description "foobar", what about to give it more life and store i/face descriptions semi-permanently, so they will survive between reboots? This patch adds a functionality to rc.d to label interfaces at boot time. Comments are welcome. %%% Index: etc/rc.d/netif =================================================================== --- etc/rc.d/netif (revision 211280) +++ etc/rc.d/netif (working copy) @@ -75,6 +75,9 @@ # Rename interfaces. ifnet_rename + + # Give description to interfaces. + ifnet_descr fi # Configure the interface(s). Index: etc/network.subr =================================================================== --- etc/network.subr (revision 211280) +++ etc/network.subr (working copy) @@ -1187,6 +1187,24 @@ return 0 } +# ifnet_descr +# Add description to all requested interfaces. +# +ifnet_descr() +{ + local _if _ifdescr + + # ifconfig_IF_descr + for _if in `ifconfig -l`; do + _ifdescr="`get_if_var $_if ifconfig_IF_descr`" + if [ ! -z "$_ifdescr" ]; then + ifconfig $_if descr "$_ifdescr" + fi + done + + return 0 +} + # list_net_interfaces type # List all network interfaces. The type of interface returned # can be controlled by the type argument. The type Index: etc/defaults/rc.conf =================================================================== --- etc/defaults/rc.conf (revision 211280) +++ etc/defaults/rc.conf (working copy) @@ -215,6 +215,7 @@ #ifconfig_ed0_ipv6="inet6 2001:db8:1::1 prefixlen 64" # Sample IPv6 addr entry #ifconfig_ed0_alias0="inet6 2001:db8:2::1 prefixlen 64" # Sample IPv6 alias #ifconfig_fxp0_name="net0" # Change interface name from fxp0 to net0. +#ifconfig_fxp0_descr="Uplink to Gigabit Switch 2" # Label fxp0 interface #vlans_fxp0="101 vlan0" # vlan(4) interfaces for fxp0 device #create_arg_vlan0="vlan 102" # vlan tag for vlan0 device #wlans_ath0="wlan0" # wlan(4) interfaces for ath0 device %%% -- wbr, pluknet --0016361e81a810124b048ebf5b14-- From owner-freebsd-rc@FreeBSD.ORG Thu Aug 26 20:36:25 2010 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 1B35A1065694 for ; Thu, 26 Aug 2010 20:36:25 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 9DCE88FC1F for ; Thu, 26 Aug 2010 20:36:24 +0000 (UTC) Received: (qmail 13043 invoked by uid 399); 26 Aug 2010 20:09:43 -0000 Received: from localhost (HELO ?192.168.0.142?) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 26 Aug 2010 20:09:43 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4C76CA06.5010001@FreeBSD.org> Date: Thu, 26 Aug 2010 13:09:42 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2 MIME-Version: 1.0 To: pluknet References: In-Reply-To: X-Enigmail-Version: 1.1.1 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: FreeBSD Current , freebsd-rc@freebsd.org Subject: Re: [RFC] ifconfig description support in rc.d 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: Thu, 26 Aug 2010 20:36:25 -0000 On 08/26/2010 12:53 PM, pluknet wrote: > [cc'ing current@ as rc@ looks too quite] > > Hi. > > Since ifconfig has grown to label interfaces with > ifconfig $ifname description "foobar", what about > to give it more life and store i/face descriptions > semi-permanently, so they will survive between reboots? > > This patch adds a functionality to rc.d to label > interfaces at boot time. > > Comments are welcome. This seems like a good addition, thanks. Please also write a patch for rc.conf.5 to describe this new functionality and I'll be happy to commit it. One note below. > --- etc/network.subr (revision 211280) > +++ etc/network.subr (working copy) > @@ -1187,6 +1187,24 @@ > return 0 > } > > +# ifnet_descr > +# Add description to all requested interfaces. > +# > +ifnet_descr() > +{ > + local _if _ifdescr > + > + # ifconfig_IF_descr > + for _if in `ifconfig -l`; do > + _ifdescr="`get_if_var $_if ifconfig_IF_descr`" > + if [ ! -z "$_ifdescr" ]; then This is probably better as [ -n "$_ifdescr" ] Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ Computers are useless. They can only give you answers. -- Pablo Picasso From owner-freebsd-rc@FreeBSD.ORG Fri Aug 27 09:17:18 2010 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 8E0FA1065670; Fri, 27 Aug 2010 09:17:18 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 0B7488FC12; Fri, 27 Aug 2010 09:17:17 +0000 (UTC) Received: by qwg5 with SMTP id 5so2806554qwg.13 for ; Fri, 27 Aug 2010 02:17:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=6qpRf0y73wJhfdDgBA9ZiHoZG3msbNmLWHbC6Q/l+E0=; b=Fw94O2+DYD9Aq5+7Kr4f7Avylg1GcL0uwTSrWHaxG1vJkt5URbx3cTqQp2yMC6+Rbj o/1G2XUOIXvGCJd5oR4UQRSPhZqw47HYBg6UA5tC58YYxeGh/+TWhATIgioo+h8PpcGX mS0bNVMU0/WjOViJP2cWRQgEIX2ak5UbZuTZk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=pHe83f31en4z5KSseu9IQ1Sil+wiYC5zXkPqIRc+3dnkDBmN8UUz88Sr76Ybun6Bvh LBi9rZPf1IYiXngDIscmMeSWxe424CJjMlUoAhDlZnByW2QVKyGsx2941N9rl5/tJh3x h/ad08nTQ7+TSgXpYVnTD/7IpN/UNc3jb7gIA= MIME-Version: 1.0 Received: by 10.224.64.167 with SMTP id e39mr127007qai.271.1282900637299; Fri, 27 Aug 2010 02:17:17 -0700 (PDT) Received: by 10.229.26.81 with HTTP; Fri, 27 Aug 2010 02:17:17 -0700 (PDT) In-Reply-To: <4C76CA06.5010001@FreeBSD.org> References: <4C76CA06.5010001@FreeBSD.org> Date: Fri, 27 Aug 2010 13:17:17 +0400 Message-ID: From: pluknet To: Doug Barton Content-Type: multipart/mixed; boundary=0016e64bbf02c4b4e7048eca940d Cc: FreeBSD Current , freebsd-rc@freebsd.org Subject: Re: [RFC] ifconfig description support in rc.d 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, 27 Aug 2010 09:17:18 -0000 --0016e64bbf02c4b4e7048eca940d Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 27 August 2010 00:09, Doug Barton wrote: > On 08/26/2010 12:53 PM, pluknet wrote: >> >> [cc'ing current@ as rc@ looks too quite] >> >> Hi. >> >> Since ifconfig has grown to label interfaces with >> ifconfig $ifname description "foobar", what about >> to give it more life and store i/face descriptions >> semi-permanently, so they will survive between reboots? >> >> This patch adds a functionality to rc.d to label >> interfaces at boot time. >> >> Comments are welcome. > > This seems like a good addition, thanks. Please also write a patch for > rc.conf.5 to describe this new functionality and I'll be happy to commit = it. Xin Li helped me with updating rc.conf.5 (thanks!). It's included in attached patch. > =A0One note below. > > >> --- etc/network.subr =A0 =A0(revision 211280) >> +++ etc/network.subr =A0 =A0(working copy) >> @@ -1187,6 +1187,24 @@ >> =A0 =A0 =A0 =A0 return 0 >> =A0} >> >> +# ifnet_descr >> +# =A0 =A0 =A0Add description to all requested interfaces. >> +# >> +ifnet_descr() >> +{ >> + =A0 =A0 =A0 local _if _ifdescr >> + >> + =A0 =A0 =A0 # ifconfig_IF_descr >> + =A0 =A0 =A0 for _if in `ifconfig -l`; do >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 _ifdescr=3D"`get_if_var $_if ifconfig_IF_d= escr`" >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if [ ! -z "$_ifdescr" ]; then > > This is probably better as [ -n "$_ifdescr" ] > This was blindly copy&pasted after ifnet_rename(). So, it makes sense probably to change test expression there as well. [see ifnet_rename() proposed change below inline] This change to ifnet_rename() is not included in attached patch to not complicate things unnecessarily for now. Index: etc/network.subr =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- etc/network.subr (revision 211280) +++ etc/network.subr (working copy) @@ -1179,7 +1179,7 @@ # ifconfig_IF_name for _if in `ifconfig -l`; do _ifname=3D`get_if_var $_if ifconfig_IF_name` - if [ ! -z "$_ifname" ]; then + if [ -n "$_ifname" ]; then ifconfig $_if name $_ifname fi done --=20 wbr, pluknet --0016e64bbf02c4b4e7048eca940d Content-Type: application/octet-stream; name="descr.rc.d.2.diff" Content-Disposition: attachment; filename="descr.rc.d.2.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gdctruj10 SW5kZXg6IGV0Yy9yYy5kL25ldGlmCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIGV0Yy9yYy5kL25ldGlmCShyZXZp c2lvbiAyMTEyODApCisrKyBldGMvcmMuZC9uZXRpZgkod29ya2luZyBjb3B5KQpAQCAtNzUsNiAr NzUsOSBAQAogCiAJCSMgUmVuYW1lIGludGVyZmFjZXMuCiAJCWlmbmV0X3JlbmFtZQorCisJCSMg R2l2ZSBkZXNjcmlwdGlvbiB0byBpbnRlcmZhY2VzLgorCQlpZm5ldF9kZXNjcgogCWZpCiAKIAkj IENvbmZpZ3VyZSB0aGUgaW50ZXJmYWNlKHMpLgpJbmRleDogZXRjL25ldHdvcmsuc3Vicgo9PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09Ci0tLSBldGMvbmV0d29yay5zdWJyCShyZXZpc2lvbiAyMTEyODApCisrKyBldGMvbmV0 d29yay5zdWJyCSh3b3JraW5nIGNvcHkpCkBAIC0xMTg3LDYgKzExODcsMjQgQEAKIAlyZXR1cm4g MAogfQogCisjIGlmbmV0X2Rlc2NyCisjCUFkZCBkZXNjcmlwdGlvbiB0byBhbGwgcmVxdWVzdGVk IGludGVyZmFjZXMuCisjCitpZm5ldF9kZXNjcigpCit7CisJbG9jYWwgX2lmIF9pZmRlc2NyCisK KwkjIGlmY29uZmlnX0lGX2Rlc2NyCisJZm9yIF9pZiBpbiBgaWZjb25maWcgLWxgOyBkbworCQlf aWZkZXNjcj0iYGdldF9pZl92YXIgJF9pZiBpZmNvbmZpZ19JRl9kZXNjcmAiCisJCWlmIFsgLW4g IiRfaWZkZXNjciIgXTsgdGhlbgorCQkJaWZjb25maWcgJF9pZiBkZXNjciAiJF9pZmRlc2NyIgor CQlmaQorCWRvbmUKKworCXJldHVybiAwCit9CisKICMgbGlzdF9uZXRfaW50ZXJmYWNlcyB0eXBl CiAjCUxpc3QgYWxsIG5ldHdvcm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