From owner-freebsd-rc@FreeBSD.ORG Sun Jul 21 17:46:22 2013 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8BF90FC8; Sun, 21 Jul 2013 17:46:22 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper.allbsd.org [IPv6:2001:2f0:104:e001::32]) by mx1.freebsd.org (Postfix) with ESMTP id 45AA4B3A; Sun, 21 Jul 2013 17:46:21 +0000 (UTC) Received: from alph.d.allbsd.org (p2049-ipbf1102funabasi.chiba.ocn.ne.jp [122.26.101.49]) (authenticated bits=128) by mail.allbsd.org (8.14.5/8.14.5) with ESMTP id r6LHk4Pg086716 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 22 Jul 2013 02:46:14 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.d.allbsd.org (8.14.5/8.14.5) with ESMTP id r6LHk2RV017158; Mon, 22 Jul 2013 02:46:03 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Mon, 22 Jul 2013 02:45:13 +0900 (JST) Message-Id: <20130722.024513.95685108976349294.hrs@allbsd.org> To: current@FreeBSD.org, freebsd-rc@FreeBSD.org Subject: CFT: cloned_interfaces and gifconfig in rc.d/netif From: Hiroki Sato X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.5 on Emacs 24.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart0(Mon_Jul_22_02_45_13_2013_666)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97.4 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (mail.allbsd.org [133.31.130.32]); Mon, 22 Jul 2013 02:46:14 +0900 (JST) X-Spam-Status: No, score=-90.4 required=13.0 tests=CONTENT_TYPE_PRESENT, DIRECTOCNDYN,DYN_PBL,QENCPTR2,RCVD_IN_PBL,SPF_SOFTFAIL,USER_IN_WHITELIST autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on gatekeeper.allbsd.org X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: freebsd-rc@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: Sun, 21 Jul 2013 17:46:22 -0000 ----Security_Multipart0(Mon_Jul_22_02_45_13_2013_666)-- Content-Type: Multipart/Mixed; boundary="--Next_Part(Mon_Jul_22_02_45_13_2013_191)--" Content-Transfer-Encoding: 7bit ----Next_Part(Mon_Jul_22_02_45_13_2013_191)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi, The attached patch allows rc.d/netif to create IFs in $cloned_interfaces when interface name(s) is specified. For example, when the following lines are in rc.conf: cloned_interfaces="bridge0 bridge1" ifconfig_bridge0="..." ifconfig_bridge1="..." The following commands create the interfaces and destroy them. # /etc/rc.d/netif start bridge0 bridge1 # /etc/rc.d/netif stop bridge0 bridge1 netif cloneup/clonedown does this without the patch, but it cannot configure the interfaces and does not support clean teardown. Also, routines which handle $gif_interfaces are merged into ones for $cloned_interfaces. ifconfig_gifN and other variants did not work with gif interfaces defined in $gif_interfaces. The patch solves this issue. Basically there should be no functionality regression for the existing configurations. Can anyone who are using $gif_interfaces and/or $cloned_interfaces test this? I would like to know if there is regression or not. -- Hiroki ----Next_Part(Mon_Jul_22_02_45_13_2013_191)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="network.subr.gifconfig.20130722-1.diff" Index: etc/network.subr =================================================================== --- etc/network.subr (revision 253520) +++ etc/network.subr (working copy) @@ -660,6 +660,11 @@ IFS="$_ifs" for _inet in $inetList ; do # get rid of extraneous line + case $_inet in + "") break ;; + inet\ *) ;; + *) continue ;; + esac [ -z "$_inet" ] && break _inet=`expr "$_inet" : '.*\(inet \([0-9]\{1,3\}\.\)\{3\}[0-9]\{1,3\}\).*'` @@ -1192,12 +1197,17 @@ # clone_up() { - local _prefix _list ifn + local _prefix _list ifn _iflist _n tmpargs _prefix= _list= + _iflist=$* # create_args_IF for ifn in ${cloned_interfaces}; do + case $_iflist in + ""|$ifn|$ifn\ *|*\ $ifn\ *|*\ $ifn) ;; + *) continue ;; + esac ${IFCONFIG_CMD} ${ifn} create `get_if_var ${ifn} create_args_IF` if [ $? -eq 0 ]; then _list="${_list}${_prefix}${ifn}" @@ -1204,6 +1214,30 @@ [ -z "$_prefix" ] && _prefix=' ' fi done + if [ -n "$gif_interfaces" ]; then + warn "\$gif_interfaces is obsolete. Use \$cloned_interfaces instead." + fi + for ifn in ${gif_interfaces}; do + case $_iflist in + ""|$ifn|$ifn\ *|*\ $ifn\ *|*\ $ifn) ;; + *) continue ;; + esac + case $ifn in + gif[0-9]*) + ${IFCONFIG_CMD} $ifn create + ;; + *) + _n=$(${IFCONFIG_CMD} gif create) + ${IFCONFIG_CMD} $_n name $ifn + ;; + esac + if [ $? -eq 0 ]; then + _list="${_list}${_prefix}${ifn}" + [ -z "$_prefix" ] && _prefix=' ' + fi + tmpargs=$(get_if_var $ifn gifconfig_IF) + eval ifconfig_${ifn}=\"tunnel \$tmpargs\" + done debug "Cloned: ${_list}" } @@ -1213,11 +1247,16 @@ # clone_down() { - local _prefix _list ifn + local _prefix _list ifn _iflist _prefix= _list= + _iflist=$* - for ifn in ${cloned_interfaces}; do + for ifn in ${cloned_interfaces} ${gif_interfaces}; do + case $_iflist in + ""|$ifn|$ifn\ *|*\ $ifn\ *|*\ $ifn) ;; + *) continue ;; + esac ${IFCONFIG_CMD} -n ${ifn} destroy if [ $? -eq 0 ]; then _list="${_list}${_prefix}${ifn}" @@ -1224,6 +1263,9 @@ [ -z "$_prefix" ] && _prefix=' ' fi done + if [ -n "${_list}" ]; then + echo "Destroyed clone interfaces: ${_list}." + fi debug "Destroyed clones: ${_list}" } @@ -1347,32 +1389,6 @@ done } -# gif_up -# Create gif(4) tunnel interfaces. -gif_up() -{ - local i peers - - for i in ${gif_interfaces}; do - peers=`get_if_var $i gifconfig_IF` - case ${peers} in - '') - continue - ;; - *) - if expr $i : 'gif[0-9][0-9]*$' >/dev/null 2>&1; then - ${IFCONFIG_CMD} $i create >/dev/null 2>&1 - else - gif=`${IFCONFIG_CMD} gif create` - ${IFCONFIG_CMD} $gif name $i - fi - ${IFCONFIG_CMD} $i tunnel ${peers} - ${IFCONFIG_CMD} $i up - ;; - esac - done -} - # ng_fec_create ifn # Configure Fast EtherChannel for interface $ifn. Returns 0 if # FEC arguments were found and configured; returns !0 otherwise. Index: etc/rc.d/netif =================================================================== --- etc/rc.d/netif (revision 253505) +++ etc/rc.d/netif (working copy) @@ -60,18 +60,15 @@ # disable SIGINT (Ctrl-c) when running at startup trap : 2 - # Create cloned interfaces - clone_up - # Create Fast EtherChannel interfaces fec_up + fi - # Create IPv6<-->IPv4 tunnels - gif_up + # Create cloned interfaces + clone_up $cmdifn - # Rename interfaces. - ifnet_rename - fi + # Rename interfaces. + ifnet_rename $cmdifn # Configure the interface(s). network_common ifn_start @@ -101,6 +98,9 @@ # Deconfigure the interface(s) network_common ifn_stop + # Destroy cloned interfaces + clone_down $cmdifn + if [ -f /etc/rc.d/routing -a -n "$cmdifn" ] ; then for _if in $cmdifn; do /etc/rc.d/routing stop any $_if ----Next_Part(Mon_Jul_22_02_45_13_2013_191)---- ----Security_Multipart0(Mon_Jul_22_02_45_13_2013_666)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (FreeBSD) iEYEABECAAYFAlHsHikACgkQTyzT2CeTzy0BogCdE5YAjK6IoMYAGLRNQtJb85kO uusAoIAK/yibxY5FiY3h67CIL1oXaOjB =uK+4 -----END PGP SIGNATURE----- ----Security_Multipart0(Mon_Jul_22_02_45_13_2013_666)---- From owner-freebsd-rc@FreeBSD.ORG Mon Jul 22 11:06:51 2013 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 23A1C4A0 for ; Mon, 22 Jul 2013 11:06:51 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 142AE24AA for ; Mon, 22 Jul 2013 11:06:51 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r6MB6ovn053815 for ; Mon, 22 Jul 2013 11:06:50 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r6MB6o2o053813 for freebsd-rc@FreeBSD.org; Mon, 22 Jul 2013 11:06:50 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 22 Jul 2013 11:06:50 GMT Message-Id: <201307221106.r6MB6o2o053813@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 Subject: Current problem reports assigned to freebsd-rc@FreeBSD.org X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.14 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, 22 Jul 2013 11:06:51 -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/180183 rc [rc.d] rc.d allows scripts without rcvar set to start o conf/179828 rc [rc.d] [PATCH] rc.d/syslogd link socket to /dev/log fa o conf/177217 rc [patch] rc.d/ddb -- squelch warning when ddb_enable=ye o conf/177089 rc ntpd startup script does not work well o conf/176347 rc [rc.conf] [patch] Add support for firewall deny lists o conf/176181 rc [rc.subr] rc.subr emitting warnings for non-defined xx o conf/175311 rc [patch] add "dump" fs type support to rc.d/dumpon o conf/175105 rc /etc/rc.d/* and more: syntax 'return_boolean_cmd && do o conf/175079 rc [rc.subr] [patch] rc.subr poorly handles recursive run o bin/173153 rc [rc.d] [patch] $netwait_ip should be more parallel o conf/172787 rc [rc.conf] FreeBSD 9.x broken alias syntax on vlan inte o conf/172532 rc [rc] [patch] service routing restart always fails o conf/169047 rc [rc.subr] [patch] /etc/rc.subr not checking some scrip p bin/168544 rc [patch] [rc]: addswap-mounted swapfiles cause panic on o conf/167566 rc [rc.d] [patch] ipdivert module loading vs. ipfw rc.d o o conf/166484 rc [rc] [patch] rc.initdiskless patch for different major o conf/165769 rc [rc][jai][ipv6] IPv6 Initialization on external iface o conf/164393 rc [rc.d] restarting netif with static addresses doesn't o conf/163508 rc [rc.subr] [patch] Add "enable" and "disable" commands o conf/163488 rc Confusing explanation in defaults/rc.conf o conf/163321 rc [rc.conf] [patch] allow _fib syntax in rc.conf o conf/162642 rc .sh scripts in /usr/local/etc/rc.d get executed, not s o conf/161107 rc [rc] stop_boot in mountcritlocal usage is incorrect. o conf/160403 rc [rc] [patch] concurrently running rc-scripts during bo o conf/160240 rc rc.d/mdconfig and mdconfig2 should autoset $_type to v o conf/159846 rc [rc.conf] routing_stop_inet6() logic doesn't handle ip o conf/158557 rc [patch] /etc/rc.d/pf broken messages o conf/158127 rc [patch] remount_optional option in rc.initdiskless doe 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/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/145399 rc [patch] rc.d scripts are unable to start/stop programs o conf/145009 rc [patch] rc.subr(8): rc.conf should allow mac label con 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 a 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/141678 rc [patch] A minor enhancement to how /etc/rc.d/jail dete o conf/140440 rc [patch] allow local command files in rc.{suspend,resum o conf/140261 rc [patch] Improve flexibility of mdconfig2 startup scrip p conf/138208 rc [rc.d] [patch] Making rc.firewall (workstation) IPv6 a o conf/137271 rc [rc.d] Cannot update /etc/host.conf when root filesyst o conf/136624 rc [rc.d] sysctl variables for ipnat are not applied on b 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/133890 rc [patch] sshd(8): add multiple profiles to the rc.d scr o conf/128299 rc [patch] /etc/rc.d/geli does not mount partitions using o conf/126392 rc [patch] rc.conf ifconfig_xx keywords cannot be escaped 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 a 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 f conf/118255 rc savecore never finding kernel core dumps (rcorder prob f conf/117935 rc [patch] ppp fails to start at boot because of missing f conf/113915 rc [ndis] [patch] ndis wireless driver fails to associate 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 f conf/105689 rc [ppp] [request] syslogd starts too late at boot f conf/105145 rc [ppp] [patch] [request] add redial function to rc.d/pp f 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/93815 rc [patch] Adds in the ability to save ipfw rules to rc.d f 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 a 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 a conf/58939 rc [patch] dumb little hack for /etc/rc.firewall{,6} f conf/56934 rc [patch] rc.firewall rules for natd expect an interface f conf/13775 rc multi-user boot may hang in NIS environment 89 problems total. From owner-freebsd-rc@FreeBSD.ORG Mon Jul 22 14:38:07 2013 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7838CDB5; Mon, 22 Jul 2013 14:38:07 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper.allbsd.org [IPv6:2001:2f0:104:e001::32]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AE94D223D; Mon, 22 Jul 2013 14:38:06 +0000 (UTC) Received: from alph.d.allbsd.org (p2049-ipbf1102funabasi.chiba.ocn.ne.jp [122.26.101.49]) (authenticated bits=128) by mail.allbsd.org (8.14.5/8.14.5) with ESMTP id r6MEbmN1014935 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 22 Jul 2013 23:37:59 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.d.allbsd.org (8.14.5/8.14.5) with ESMTP id r6MEbl1T030354; Mon, 22 Jul 2013 23:37:48 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Mon, 22 Jul 2013 23:37:04 +0900 (JST) Message-Id: <20130722.233704.43939809189059350.hrs@allbsd.org> To: current@FreeBSD.org, freebsd-rc@FreeBSD.org Subject: Re: CFT: cloned_interfaces and gifconfig in rc.d/netif From: Hiroki Sato In-Reply-To: <20130722.024513.95685108976349294.hrs@allbsd.org> References: <20130722.024513.95685108976349294.hrs@allbsd.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.5 on Emacs 24.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart0(Mon_Jul_22_23_37_04_2013_579)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97.4 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (mail.allbsd.org [133.31.130.32]); Mon, 22 Jul 2013 23:37:59 +0900 (JST) X-Spam-Status: No, score=-90.4 required=13.0 tests=CONTENT_TYPE_PRESENT, DIRECTOCNDYN,DYN_PBL,QENCPTR2,RCVD_IN_PBL,SPF_SOFTFAIL,USER_IN_WHITELIST autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on gatekeeper.allbsd.org X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: freebsd-rc@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, 22 Jul 2013 14:38:07 -0000 ----Security_Multipart0(Mon_Jul_22_23_37_04_2013_579)-- Content-Type: Multipart/Mixed; boundary="--Next_Part(Mon_Jul_22_23_37_04_2013_233)--" Content-Transfer-Encoding: 7bit ----Next_Part(Mon_Jul_22_23_37_04_2013_233)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hiroki Sato wrote in <20130722.024513.95685108976349294.hrs@allbsd.org>: hr> Hi, hr> hr> The attached patch allows rc.d/netif to create IFs in hr> $cloned_interfaces when interface name(s) is specified. For example, hr> when the following lines are in rc.conf: hr> hr> cloned_interfaces="bridge0 bridge1" hr> ifconfig_bridge0="..." hr> ifconfig_bridge1="..." hr> hr> The following commands create the interfaces and destroy them. hr> hr> # /etc/rc.d/netif start bridge0 bridge1 hr> # /etc/rc.d/netif stop bridge0 bridge1 hr> hr> netif cloneup/clonedown does this without the patch, but it cannot hr> configure the interfaces and does not support clean teardown. hr> hr> Also, routines which handle $gif_interfaces are merged into ones for hr> $cloned_interfaces. ifconfig_gifN and other variants did not work hr> with gif interfaces defined in $gif_interfaces. The patch solves hr> this issue. hr> hr> Basically there should be no functionality regression for the hr> existing configurations. Can anyone who are using $gif_interfaces hr> and/or $cloned_interfaces test this? I would like to know if there is hr> regression or not. A revised version based on feedback which I received in private emails is attached. This includes rc.conf(5) change explaining the new variables. The following is a brief description of the changes: ----- - Reimplement gif_interfaces as a variant of $cloned_interfaces. Newly-configured systems should use $cloned_interfaces. - Call clone_{up,down}() in rc.d/netif {start,stop}. - Add rc.d/netif clear. The "clear" argument is basically equivalent to "stop" but it does not call clone_down(). - Add "ifname:sticky" keyword into $cloned_interfaces. If :sticky is specified, the interface will not be destroyed in rc.d/netif stop. - Add cloned_interfaces_sticky={YES,NO}. This variable globally sets :sticky keyword above for all interfaces. The default value is NO. ---- -- Hiroki ----Next_Part(Mon_Jul_22_23_37_04_2013_233)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="network.subr.gifconfig.20130722-2.diff" - Reimplement gif_interfaces as a variant of $cloned_interfaces. Newly-configured systems should use $cloned_interfaces. - Call clone_{up,down}() in rc.d/netif {start,stop}. - Add rc.d/netif clear. The "clear" argument is basically equivalent to "stop" but it does not call clone_down(). - Add "ifname:sticky" keyword into $cloned_interfaces. If :sticky is specified, the interface will not be destroyed in rc.d/netif stop. - Add cloned_interfaces_sticky={YES,NO}. This variable globally sets :sticky keyword above for all interfaces. The default value is NO. MFC after: 3 days ==== Index: etc/network.subr =================================================================== --- etc/network.subr (revision 253520) +++ etc/network.subr (working copy) @@ -660,6 +660,11 @@ ipv4_down() IFS="$_ifs" for _inet in $inetList ; do # get rid of extraneous line + case $_inet in + "") break ;; + inet\ *) ;; + *) continue ;; + esac [ -z "$_inet" ] && break _inet=`expr "$_inet" : '.*\(inet \([0-9]\{1,3\}\.\)\{3\}[0-9]\{1,3\}\).*'` @@ -1192,12 +1197,23 @@ ifscript_down() # clone_up() { - local _prefix _list ifn + local _prefix _list ifn ifopt _iflist _n tmpargs _prefix= _list= + _iflist=$* # create_args_IF for ifn in ${cloned_interfaces}; do + # Parse ifn:ifopt. + OIFS=$IFS; IFS=:; set -- $ifn; ifn=$1; ifopt=$2; IFS=$OIFS + case $_iflist in + ""|$ifn|$ifn\ *|*\ $ifn\ *|*\ $ifn) ;; + *) continue ;; + esac + # Skip if ifn already exists. + if ${IFCONFIG_CMD} $ifn > /dev/null 2>&1; then + continue + fi ${IFCONFIG_CMD} ${ifn} create `get_if_var ${ifn} create_args_IF` if [ $? -eq 0 ]; then _list="${_list}${_prefix}${ifn}" @@ -1204,6 +1220,39 @@ clone_up() [ -z "$_prefix" ] && _prefix=' ' fi done + if [ -n "$gif_interfaces" ]; then + warn "\$gif_interfaces is obsolete. Use \$cloned_interfaces instead." + fi + for ifn in ${gif_interfaces}; do + # Parse ifn:ifopt. + OIFS=$IFS; IFS=:; set -- $ifn; ifn=$1; ifopt=$2; IFS=$OIFS + case $_iflist in + ""|$ifn|$ifn\ *|*\ $ifn\ *|*\ $ifn) ;; + *) continue ;; + esac + # Skip if ifn already exists. + if ${IFCONFIG_CMD} $ifn > /dev/null 2>&1; then + continue + fi + case $ifn in + gif[0-9]*) + ${IFCONFIG_CMD} $ifn create + ;; + *) + _n=$(${IFCONFIG_CMD} gif create) + ${IFCONFIG_CMD} $_n name $ifn + ;; + esac + if [ $? -eq 0 ]; then + _list="${_list}${_prefix}${ifn}" + [ -z "$_prefix" ] && _prefix=' ' + fi + tmpargs=$(get_if_var $ifn gifconfig_IF) + eval ifconfig_${ifn}=\"tunnel \$tmpargs\" + done + if [ -n "${_list}" ]; then + echo "Created clone interfaces: ${_list}." + fi debug "Cloned: ${_list}" } @@ -1213,11 +1262,29 @@ clone_up() # clone_down() { - local _prefix _list ifn + local _prefix _list ifn ifopt _iflist _prefix= _list= + _iflist=$* - for ifn in ${cloned_interfaces}; do + : ${cloned_interfaces_sticky:=NO} + if checkyesno cloned_interfaces_sticky; then + return 1 + fi + for ifn in ${cloned_interfaces} ${gif_interfaces}; do + # Parse ifn:ifopt. + OIFS=$IFS; IFS=:; set -- $ifn; ifn=$1; ifopt=$2; IFS=$OIFS + case $ifopt in + sticky) continue ;; + esac + case $_iflist in + ""|$ifn|$ifn\ *|*\ $ifn\ *|*\ $ifn) ;; + *) continue ;; + esac + # Skip if ifn does not exist. + if ! ${IFCONFIG_CMD} $ifn > /dev/null 2>&1; then + continue + fi ${IFCONFIG_CMD} -n ${ifn} destroy if [ $? -eq 0 ]; then _list="${_list}${_prefix}${ifn}" @@ -1224,6 +1291,9 @@ clone_down() [ -z "$_prefix" ] && _prefix=' ' fi done + if [ -n "${_list}" ]; then + echo "Destroyed clone interfaces: ${_list}." + fi debug "Destroyed clones: ${_list}" } @@ -1347,32 +1417,6 @@ ng_create_one() done } -# gif_up -# Create gif(4) tunnel interfaces. -gif_up() -{ - local i peers - - for i in ${gif_interfaces}; do - peers=`get_if_var $i gifconfig_IF` - case ${peers} in - '') - continue - ;; - *) - if expr $i : 'gif[0-9][0-9]*$' >/dev/null 2>&1; then - ${IFCONFIG_CMD} $i create >/dev/null 2>&1 - else - gif=`${IFCONFIG_CMD} gif create` - ${IFCONFIG_CMD} $gif name $i - fi - ${IFCONFIG_CMD} $i tunnel ${peers} - ${IFCONFIG_CMD} $i up - ;; - esac - done -} - # ng_fec_create ifn # Configure Fast EtherChannel for interface $ifn. Returns 0 if # FEC arguments were found and configured; returns !0 otherwise. Index: etc/rc.d/netif =================================================================== --- etc/rc.d/netif (revision 253505) +++ etc/rc.d/netif (working copy) @@ -38,7 +38,8 @@ start_cmd="network_start" stop_cmd="network_stop" cloneup_cmd="clone_up" clonedown_cmd="clone_down" -extra_commands="cloneup clonedown" +clear_cmd="clear" +extra_commands="cloneup clonedown clear" cmdifn= set_rcvar_obsolete ipv6_enable ipv6_activate_all_interfaces @@ -60,18 +61,15 @@ network_start() # disable SIGINT (Ctrl-c) when running at startup trap : 2 - # Create cloned interfaces - clone_up - # Create Fast EtherChannel interfaces fec_up + fi - # Create IPv6<-->IPv4 tunnels - gif_up + # Create cloned interfaces + clone_up $cmdifn - # Rename interfaces. - ifnet_rename - fi + # Rename interfaces. + ifnet_rename $cmdifn # Configure the interface(s). network_common ifn_start @@ -92,6 +90,18 @@ network_start() network_stop() { + _clone_down=1 + network_stop0 $* +} + +clear() +{ + _clone_down= + network_stop0 $* +} + +network_stop0() +{ local _if # Set the list of interfaces to work on. @@ -101,6 +111,11 @@ network_stop() # Deconfigure the interface(s) network_common ifn_stop + # Destroy cloned interfaces + if [ -n "$_clone_down" ]; then + clone_down $cmdifn + fi + if [ -f /etc/rc.d/routing -a -n "$cmdifn" ] ; then for _if in $cmdifn; do /etc/rc.d/routing stop any $_if @@ -142,6 +157,16 @@ network_common() _fail= _ok= for ifn in ${_cooked_list}; do + # Skip if ifn does not exist. + case $_func in + ifn_stop) + if ! ${IFCONFIG_CMD} $ifn > /dev/null 2>&1; then + warn "$ifn does not exist. Skipped." + _fail="${_fail} ${ifn}" + continue + fi + ;; + esac if ${_func} ${ifn} $2; then _ok="${_ok} ${ifn}" if ipv6if ${ifn}; then Index: share/man/man5/rc.conf.5 =================================================================== --- share/man/man5/rc.conf.5 (revision 253545) +++ share/man/man5/rc.conf.5 (working copy) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 12, 2013 +.Dd July 22, 2013 .Dt RC.CONF 5 .Os .Sh NAME @@ -1651,11 +1651,29 @@ Further cloning arguments may be passed to the command for each interface by setting the .Va create_args_ Ns Aq Ar interface variable. +If an interface name is specified with +.Dq :sticky +keyword, +the interface will not be destroyed even when +.Pa rc.d/netif +script is invoked with +.Dq stop +argument. +This is useful when reconfiguring the interface without destroying it. Entries in .Va cloned_interfaces are automatically appended to .Va network_interfaces for configuration. +.It Va cloned_interfaces_sticky +.Pq Vt bool +This variable is to globally enable functionality of +.Dq :sticky +keyword in +.Va cloned_interfaces +for all interfaces. +The default value is +.Dq NO . .It Va fec_interfaces .Pq Vt str Set to the list of @@ -1685,6 +1703,8 @@ ifconfig_fec0="DHCP" .Ed .It Va gif_interfaces .Pq Vt str +This variable is deprecated in favor of +.Va cloned_interfaces . Set to the list of .Xr gif 4 tunnel interfaces to configure on this host. ----Next_Part(Mon_Jul_22_23_37_04_2013_233)---- ----Security_Multipart0(Mon_Jul_22_23_37_04_2013_579)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (FreeBSD) iEYEABECAAYFAlHtQ5AACgkQTyzT2CeTzy3AyQCg0dtCgRIbHAiH+qim8X50xTBJ RNcAn0OBevMIpxXxjMi0ZXf66CAAwOkp =nMwt -----END PGP SIGNATURE----- ----Security_Multipart0(Mon_Jul_22_23_37_04_2013_579)---- From owner-freebsd-rc@FreeBSD.ORG Tue Jul 23 05:48:40 2013 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7B962B35 for ; Tue, 23 Jul 2013 05:48:40 +0000 (UTC) (envelope-from meerakumari.seo@gmail.com) Received: from mail-pd0-x22d.google.com (mail-pd0-x22d.google.com [IPv6:2607:f8b0:400e:c02::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 576A9280C for ; Tue, 23 Jul 2013 05:48:40 +0000 (UTC) Received: by mail-pd0-f173.google.com with SMTP id bv13so431342pdb.18 for ; Mon, 22 Jul 2013 22:48:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:reply-to:from:to:subject:date:mime-version:content-type :x-mailer:thread-index:x-mimeole; bh=u0/LzkYhLqLcZAWSLAsepReTV0TCgaymhW6eIQ+nhQs=; b=Czfo1ZWshcmpH54z6k03FJWASTMJ/ecnl+BqtwW1JT4k1E5XLdOJdswFyWoFMuJX6i 6GeEktZ56inQ+fzSYaP3I1agNf5aolPmSg6CIJ8xYHuibLUc372Hh33JnIly/fYXBDBk azFUpJy5obhZoapwueS9gqQd0w8UV4/0bqoDFcVe7XQmtQIjadGuB+i7BgXVhXTsRzqI kacNk+1sSX9edS05hEiK3XpWbYLm6KlnCe018EaeTPYt2Ysd6giBauDW67RDGd5K00St T63OW1g8LASRmPd/cUCOKxJYs18qdR8and86xgpBJLDlaSJYEffswnS3Hs8VsUg3l2Gm TGwQ== X-Received: by 10.68.173.97 with SMTP id bj1mr34806013pbc.176.1374558519944; Mon, 22 Jul 2013 22:48:39 -0700 (PDT) Received: from TOSHIBAPC ([122.177.227.144]) by mx.google.com with ESMTPSA id jb2sm39689576pbc.8.2013.07.22.22.48.37 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 22 Jul 2013 22:48:39 -0700 (PDT) Message-ID: <51ee1937.62c6440a.5b63.ffffb98d@mx.google.com> From: "Taleen" To: Subject: Google ranking your targeted keywords!! Date: Tue, 23 Jul 2013 11:18:02 +0530 MIME-Version: 1.0 X-Mailer: Microsoft Office Outlook, Build 11.0.5510 Thread-Index: Ac6HaC54s0nlmnLxSQuQa8tNvEfOCw== X-MimeOLE: Produced By Microsoft MimeOLE V6.1.7601.17609 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: meerakumari.seo@gmail.com 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, 23 Jul 2013 05:48:40 -0000 Hi, Would you like to increase the leads/sales generated from your website? Would you like to be listed at the top of every major search engine such as Google, Yahoo! & Bing for multiple search phrases (keywords) relevant to your products / services? We provide a complete solution for your Online Business need. Our Steps and the Activities to Rank. 1. Keywords Research 2. Competition Analysis 3. Optimized Content Creation 4. Keywords Optimization 5. Back Link Creation/Link Building 6. Submission to Search Engines and Directories 7. Submission to Article Directories We are a team of 100+ professionals which includes 50 full time SEO experts. We are proud to inform you that our team handled 200+ SEO projects and obtained 150000+ manually built links in the past 1 year. We will be glad to assist you with offering our services. Contact us for the best quote for your website & we'll place your website on Top page Google ranking for targeted keywords. -------------------------- -- Kind Regards Taleen From owner-freebsd-rc@FreeBSD.ORG Wed Jul 24 10:54:51 2013 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B3FDCCBC; Wed, 24 Jul 2013 10:54:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id D6ABD2968; Wed, 24 Jul 2013 10:54:50 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id NAA19197; Wed, 24 Jul 2013 13:54:49 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1V1wiW-000898-Nw; Wed, 24 Jul 2013 13:54:48 +0300 Message-ID: <51EFB254.8070807@FreeBSD.org> Date: Wed, 24 Jul 2013 13:54:12 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130708 Thunderbird/17.0.7 MIME-Version: 1.0 To: freebsd-fs@FreeBSD.org, freebsd-rc@FreeBSD.org Subject: rc.d support for zfs boot environments X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=X-VIET-VPS Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Jul 2013 10:54:51 -0000 I would like to add another rc.d script or extend the current rc.d/zfs script for enhanced support of ZFS boot environments. To be short, a ZFS boot environment is a filesystem that typically has loader, kernel and can be mounted as a root filesystem. By having multiple filesystems of this kind a user can easily select which one to boot to. This allows for things like having known good configurations, easily recovering from failed upgrades, experimenting with new code, etc. One of the features of boot environments is support for subordinate filesystems. For example: NAME MOUNTPOINT CANMOUNT pond/ROOT/20130331 /pond/ROOT/20130331 noauto pond/ROOT/20130331/usr /usr off pond/ROOT/20130331/usr/local /usr/local noauto pond/ROOT/20130331/usr/local/etc /usr/local/etc noauto pond/ROOT/kms /pond/ROOT/kms noauto pond/ROOT/kms/usr /usr off pond/ROOT/kms/usr/local /usr/local noauto pond/ROOT/kms/usr/local/etc /usr/local/etc noauto 20130331 and kms are two boot environments here. .../usr, .../usr/local, .../usr/local/etc are their subordinate datasets / filesystems. The idea is that one can have filesystems that are tied to a boot environment. These filesystems hold files that must be in the boot environment but they are better to be stored in a different filesystem than the main one. There can be different reasons for this like a need for different ZFS properties or convenience of separate management (snapshots, cloning, etc). Because these filesystems should not be automatically mounted during boot they are configured with canmount=noauto. The root filesystem is mounted automatically by the kernel. But the subordinate filesystems are not mounted by rc.d/zfs -> zfs mount -a because of the canmount property. So they need to be mounted explicitly. Below is a patch that I have for this case. I would like to ask both fs@ and rc@ communities to review the patch for correctness, soundness and style. I will appreciate any suggestions and comments. If you are already using boot environments and think that you may need to use subordinate datasets, then testing is most welcome too. commit df1df94f75a13f611a8234b01bfb9d6b43172c45 Author: Andriy Gapon Date: Sun Jul 7 21:01:27 2013 +0300 rc.d/zfsbe: a new script designed for boot environment support currently it ensures that subordinate datasets are mounted at the right points. diff --git a/etc/rc.d/zfs b/etc/rc.d/zfs index 598723a..3c40043 100755 --- a/etc/rc.d/zfs +++ b/etc/rc.d/zfs @@ -4,7 +4,7 @@ # # PROVIDE: zfs -# REQUIRE: mountcritlocal +# REQUIRE: zfsbe . /etc/rc.subr diff --git a/etc/rc.d/zfsbe b/etc/rc.d/zfsbe new file mode 100755 index 0000000..9e4c50e --- /dev/null +++ b/etc/rc.d/zfsbe @@ -0,0 +1,70 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: zfsbe +# REQUIRE: mountcritlocal + +# Handle boot environment subordinate filesystems +# that may have canmount property set to noauto. +# For these filesystems mountpoint relative to / +# must be the same as their dataset name relative +# to BE root dataset. + +. /etc/rc.subr + +name="zfsbe" +rcvar="zfs_enable" +start_cmd="be_start" +stop_cmd="be_stop" +required_modules="zfs" + +mount_subordinate() +{ + local _be + + _be=$1 + zfs list -rH -o mountpoint,name,canmount -s mountpoint -t filesystem $_be | \ + while read _mp _name _canmount ; do + [ "$_canmount" = "off" ] && continue + case "$_mp" in + "") + ;; + "legacy") + ;; + "/") + ;; + "/$_be") + ;; + "/$_be/"*) + mount -t zfs $_name ${_mp#/$_be} + ;; + *) + zfs mount $_name + ;; + esac + done +} + +be_start() +{ + if [ `$SYSCTL_N security.jail.jailed` -eq 1 ]; then + : + else + mount -p | while read _dev _mp _type _rest; do + [ $_mp = "/" ] || continue + if [ $_type = "zfs" ] ; then + mount_subordinate $_dev + fi + break + done + fi +} + +be_stop() +{ +} + +load_rc_config $name +run_rc_command "$1" -- Andriy Gapon From owner-freebsd-rc@FreeBSD.ORG Wed Jul 24 13:06:00 2013 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7BD94EC9; Wed, 24 Jul 2013 13:06:00 +0000 (UTC) (envelope-from lifanov@mail.lifanov.com) Received: from mail.lifanov.com (mail.lifanov.com [206.125.175.12]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 55D6C2EB5; Wed, 24 Jul 2013 13:06:00 +0000 (UTC) Received: from [10.1.3.5] (cnet520-windstream.mcclatchyinteractive.com [166.108.16.2]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.lifanov.com (Postfix) with ESMTPSA id 75C721A0638; Wed, 24 Jul 2013 13:05:54 +0000 (UTC) Message-ID: <51EFD131.4090004@mail.lifanov.com> Date: Wed, 24 Jul 2013 09:05:53 -0400 From: Nikolai Lifanov User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130628 Thunderbird/17.0.7 MIME-Version: 1.0 To: avg@FreeBSD.org Subject: Re: freebsd-fs Digest, Vol 527, Issue 3 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-fs@freebsd.org, freebsd-rc@freebsd.org X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Jul 2013 13:06:00 -0000 On 07/24/13 08:00, freebsd-fs-request@freebsd.org wrote: > Send freebsd-fs mailing list submissions to > freebsd-fs@freebsd.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://lists.freebsd.org/mailman/listinfo/freebsd-fs > or, via email, send a message with subject or body 'help' to > freebsd-fs-request@freebsd.org > > You can reach the person managing the list at > freebsd-fs-owner@freebsd.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of freebsd-fs digest..." > > > Today's Topics: > > 1. Revisiting an old problem.. zfs snapshots and file name too > long (Andreas Tyrosvoutis) > 2. Bug in FUSE unmounting (Nathan Whitehorn) > 3. rc.d support for zfs boot environments (Andriy Gapon) > 4. Re: [SOLVED] Re: Shutdown problem with an USB memory stick as > ZFS cache device (Ronald Klop) > 5. Re: r253070 and "disappearing" zpool (Andriy Gapon) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 23 Jul 2013 19:48:01 +0300 > From: Andreas Tyrosvoutis > To: freebsd-fs@freebsd.org > Subject: Revisiting an old problem.. zfs snapshots and file name too > long > Message-ID: > > Content-Type: text/plain; charset=UTF-8 > > Hi there everyone, I wanted to see what has been discovered regarding this > issue. This particular issue has been around since at least 2008. > > http://lists.freebsd.org/pipermail/freebsd-fs/2008-November/005286.html > > A little bit of response and progress noted here: > > http://lists.freebsd.org/pipermail/freebsd-fs/2010-March/007960.html > http://lists.freebsd.org/pipermail/freebsd-fs/2010-March/007964.html > http://lists.freebsd.org/pipermail/freebsd-fs/2010-March/007972.html > http://lists.freebsd.org/pipermail/freebsd-fs/2010-March/007974.html > > > "Such change will break ABI compatibility with tools compiled on previous > FreeBSD versions. As you can see in sys/sys/mount.h this is the reason > we still keep ostatfs structure. *I'll discuss the possibilities with > other FreeBSD committers and we will see what we can do about it.*" > > As far as I can tell, this problem has not been addressed in a > satisfactory way, and still exists today. > > nas4free: snapshot # uname -a > > FreeBSD nas4free.office.pytheasgroup.com 9.1-RELEASE-p3 FreeBSD > 9.1-RELEASE-p3 #0 r251670M: Thu Jun 13 01:59:24 CEST 2013 > root@dev.nas4free.org:/usr/obj/nas4free/usr/src/sys/NAS4FREE-amd64 > amd64 > > nas4free: snapshot # pwd > > /mnt/usb-backup/Daily-Backups/mypool/home/andreas/.zfs/snapshot > > nas4free: snapshot # ls > > ls: 20130721_1829_autosnap_HOURLY: File name too long > > ls: 20130721_2330_autosnap_HOURLY: File name too long > > ls: 20130722_0936_autosnap_HOURLY: File name too long > > ls: 20130722_1221_autosnap_HOURLY: File name too long > > etc.... > > Not being able to use arbitrarily named snapshots or any tools in > .zfs/snapshot folders containing such long named (72 characters? ) > snapshots seems a bit, contrary to the ZFS philosophy of (almost) > unreachable limits. > > The problem is, I don't know what ABI and ostatfs or any of that is. > Or what can actually be done about the problem. It would be handy if > someone who is in the know, could definitively declare the issues > ability to be, or not to be resolved. And perhaps if it can, I'd like > to push it in the right direction. Otherwise it appears to be that BSD > and ZFS are not really fully integrated. > > What do I know though. :) > > > ------------------------------ > > Message: 2 > Date: Tue, 23 Jul 2013 22:31:30 -0500 > From: Nathan Whitehorn > To: freebsd-fs@freebsd.org > Subject: Bug in FUSE unmounting > Message-ID: <51EF4A92.1090203@freebsd.org> > Content-Type: text/plain; CHARSET=US-ASCII > > I ran across a bug in our FUSE port today. The unmount code in libfuse > (mount_bsd.c) uses umount -f to unmount a file system. To do this, it > looks up the device name corresponding to the process's communication > file descriptor, calls getdevname() on it, and then passes that to > umount. The problem here is that the device is always /dev/fuse (it > seems to assume there is a number on the end) and, as a result, it will > forcibly unmount *all* FUSE systems when trying just to unmount one. > > Using the mountpoint instead seems to work for me, but a better solution > is called for. > -Nathan > > > ------------------------------ > > Message: 3 > Date: Wed, 24 Jul 2013 13:54:12 +0300 > From: Andriy Gapon > To: freebsd-fs@FreeBSD.org, freebsd-rc@FreeBSD.org > Subject: rc.d support for zfs boot environments > Message-ID: <51EFB254.8070807@FreeBSD.org> > Content-Type: text/plain; charset=X-VIET-VPS > > > I would like to add another rc.d script or extend the current rc.d/zfs script > for enhanced support of ZFS boot environments. > > To be short, a ZFS boot environment is a filesystem that typically has loader, > kernel and can be mounted as a root filesystem. By having multiple filesystems > of this kind a user can easily select which one to boot to. This allows for > things like having known good configurations, easily recovering from failed > upgrades, experimenting with new code, etc. > > One of the features of boot environments is support for subordinate filesystems. > For example: > NAME MOUNTPOINT CANMOUNT > pond/ROOT/20130331 /pond/ROOT/20130331 noauto > pond/ROOT/20130331/usr /usr off > pond/ROOT/20130331/usr/local /usr/local noauto > pond/ROOT/20130331/usr/local/etc /usr/local/etc noauto > pond/ROOT/kms /pond/ROOT/kms noauto > pond/ROOT/kms/usr /usr off > pond/ROOT/kms/usr/local /usr/local noauto > pond/ROOT/kms/usr/local/etc /usr/local/etc noauto > > 20130331 and kms are two boot environments here. > .../usr, .../usr/local, .../usr/local/etc are their subordinate datasets / > filesystems. > The idea is that one can have filesystems that are tied to a boot environment. > These filesystems hold files that must be in the boot environment but they are > better to be stored in a different filesystem than the main one. There can be > different reasons for this like a need for different ZFS properties or > convenience of separate management (snapshots, cloning, etc). > > Because these filesystems should not be automatically mounted during boot they > are configured with canmount=noauto. The root filesystem is mounted > automatically by the kernel. But the subordinate filesystems are not mounted by > rc.d/zfs -> zfs mount -a because of the canmount property. So they need to be > mounted explicitly. > > Below is a patch that I have for this case. > I would like to ask both fs@ and rc@ communities to review the patch for > correctness, soundness and style. I will appreciate any suggestions and comments. > If you are already using boot environments and think that you may need to use > subordinate datasets, then testing is most welcome too. > > commit df1df94f75a13f611a8234b01bfb9d6b43172c45 > Author: Andriy Gapon > Date: Sun Jul 7 21:01:27 2013 +0300 > > rc.d/zfsbe: a new script designed for boot environment support > > currently it ensures that subordinate datasets are mounted at the > right points. > > diff --git a/etc/rc.d/zfs b/etc/rc.d/zfs > index 598723a..3c40043 100755 > --- a/etc/rc.d/zfs > +++ b/etc/rc.d/zfs > @@ -4,7 +4,7 @@ > # > > # PROVIDE: zfs > -# REQUIRE: mountcritlocal > +# REQUIRE: zfsbe > > . /etc/rc.subr > > diff --git a/etc/rc.d/zfsbe b/etc/rc.d/zfsbe > new file mode 100755 > index 0000000..9e4c50e > --- /dev/null > +++ b/etc/rc.d/zfsbe > @@ -0,0 +1,70 @@ > +#!/bin/sh > +# > +# $FreeBSD$ > +# > + > +# PROVIDE: zfsbe > +# REQUIRE: mountcritlocal > + > +# Handle boot environment subordinate filesystems > +# that may have canmount property set to noauto. > +# For these filesystems mountpoint relative to / > +# must be the same as their dataset name relative > +# to BE root dataset. > + > +. /etc/rc.subr > + > +name="zfsbe" > +rcvar="zfs_enable" > +start_cmd="be_start" > +stop_cmd="be_stop" > +required_modules="zfs" > + > +mount_subordinate() > +{ > + local _be > + > + _be=$1 > + zfs list -rH -o mountpoint,name,canmount -s mountpoint -t filesystem $_be | \ > + while read _mp _name _canmount ; do > + [ "$_canmount" = "off" ] && continue > + case "$_mp" in > + "") > + ;; > + "legacy") > + ;; > + "/") > + ;; > + "/$_be") > + ;; > + "/$_be/"*) > + mount -t zfs $_name ${_mp#/$_be} > + ;; > + *) > + zfs mount $_name > + ;; > + esac > + done > +} > + > +be_start() > +{ > + if [ `$SYSCTL_N security.jail.jailed` -eq 1 ]; then > + : > + else > + mount -p | while read _dev _mp _type _rest; do > + [ $_mp = "/" ] || continue > + if [ $_type = "zfs" ] ; then > + mount_subordinate $_dev > + fi > + break > + done > + fi > +} > + > +be_stop() > +{ > +} > + > +load_rc_config $name > +run_rc_command "$1" > You might check out the logic in the excellent sysutils/beadm port. It's all shell and doesn't actually need rc support or even use it. However, loader(8) support for selecting a boot environment would be really useful. - Nikolai Lifanov From owner-freebsd-rc@FreeBSD.ORG Wed Jul 24 13:55:42 2013 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1C203ECB; Wed, 24 Jul 2013 13:55:42 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EF31320C4; Wed, 24 Jul 2013 13:55:40 +0000 (UTC) Received: from jre-mbp.elischer.org (etroy.elischer.org [121.45.226.51]) (authenticated bits=0) by vps1.elischer.org (8.14.7/8.14.6) with ESMTP id r6ODtUVq025161 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 24 Jul 2013 06:55:32 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <51EFDCCC.4040205@freebsd.org> Date: Wed, 24 Jul 2013 21:55:24 +0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: Andriy Gapon Subject: Re: rc.d support for zfs boot environments References: <51EFB254.8070807@FreeBSD.org> In-Reply-To: <51EFB254.8070807@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: freebsd-fs@FreeBSD.org, freebsd-rc@FreeBSD.org X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Jul 2013 13:55:42 -0000 On 7/24/13 6:54 PM, Andriy Gapon wrote: > I would like to add another rc.d script or extend the current rc.d/zfs script > for enhanced support of ZFS boot environments. isn't this what PC-BSD are working on? > > To be short, a ZFS boot environment is a filesystem that typically has loader, > kernel and can be mounted as a root filesystem. By having multiple filesystems > of this kind a user can easily select which one to boot to. This allows for > things like having known good configurations, easily recovering from failed > upgrades, experimenting with new code, etc. > > One of the features of boot environments is support for subordinate filesystems. > For example: > NAME MOUNTPOINT CANMOUNT > pond/ROOT/20130331 /pond/ROOT/20130331 noauto > pond/ROOT/20130331/usr /usr off > pond/ROOT/20130331/usr/local /usr/local noauto > pond/ROOT/20130331/usr/local/etc /usr/local/etc noauto > pond/ROOT/kms /pond/ROOT/kms noauto > pond/ROOT/kms/usr /usr off > pond/ROOT/kms/usr/local /usr/local noauto > pond/ROOT/kms/usr/local/etc /usr/local/etc noauto > > 20130331 and kms are two boot environments here. > .../usr, .../usr/local, .../usr/local/etc are their subordinate datasets / > filesystems. > The idea is that one can have filesystems that are tied to a boot environment. > These filesystems hold files that must be in the boot environment but they are > better to be stored in a different filesystem than the main one. There can be > different reasons for this like a need for different ZFS properties or > convenience of separate management (snapshots, cloning, etc). > > Because these filesystems should not be automatically mounted during boot they > are configured with canmount=noauto. The root filesystem is mounted > automatically by the kernel. But the subordinate filesystems are not mounted by > rc.d/zfs -> zfs mount -a because of the canmount property. So they need to be > mounted explicitly. > > Below is a patch that I have for this case. > I would like to ask both fs@ and rc@ communities to review the patch for > correctness, soundness and style. I will appreciate any suggestions and comments. > If you are already using boot environments and think that you may need to use > subordinate datasets, then testing is most welcome too. > > commit df1df94f75a13f611a8234b01bfb9d6b43172c45 > Author: Andriy Gapon > Date: Sun Jul 7 21:01:27 2013 +0300 > > rc.d/zfsbe: a new script designed for boot environment support > > currently it ensures that subordinate datasets are mounted at the > right points. > > diff --git a/etc/rc.d/zfs b/etc/rc.d/zfs > index 598723a..3c40043 100755 > --- a/etc/rc.d/zfs > +++ b/etc/rc.d/zfs > @@ -4,7 +4,7 @@ > # > > # PROVIDE: zfs > -# REQUIRE: mountcritlocal > +# REQUIRE: zfsbe > > . /etc/rc.subr > > diff --git a/etc/rc.d/zfsbe b/etc/rc.d/zfsbe > new file mode 100755 > index 0000000..9e4c50e > --- /dev/null > +++ b/etc/rc.d/zfsbe > @@ -0,0 +1,70 @@ > +#!/bin/sh > +# > +# $FreeBSD$ > +# > + > +# PROVIDE: zfsbe > +# REQUIRE: mountcritlocal > + > +# Handle boot environment subordinate filesystems > +# that may have canmount property set to noauto. > +# For these filesystems mountpoint relative to / > +# must be the same as their dataset name relative > +# to BE root dataset. > + > +. /etc/rc.subr > + > +name="zfsbe" > +rcvar="zfs_enable" > +start_cmd="be_start" > +stop_cmd="be_stop" > +required_modules="zfs" > + > +mount_subordinate() > +{ > + local _be > + > + _be=$1 > + zfs list -rH -o mountpoint,name,canmount -s mountpoint -t filesystem $_be | \ > + while read _mp _name _canmount ; do > + [ "$_canmount" = "off" ] && continue > + case "$_mp" in > + "") > + ;; > + "legacy") > + ;; > + "/") > + ;; > + "/$_be") > + ;; > + "/$_be/"*) > + mount -t zfs $_name ${_mp#/$_be} > + ;; > + *) > + zfs mount $_name > + ;; > + esac > + done > +} > + > +be_start() > +{ > + if [ `$SYSCTL_N security.jail.jailed` -eq 1 ]; then > + : > + else > + mount -p | while read _dev _mp _type _rest; do > + [ $_mp = "/" ] || continue > + if [ $_type = "zfs" ] ; then > + mount_subordinate $_dev > + fi > + break > + done > + fi > +} > + > +be_stop() > +{ > +} > + > +load_rc_config $name > +run_rc_command "$1" > > > > _______________________________________________ > freebsd-fs@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-fs > To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org" From owner-freebsd-rc@FreeBSD.ORG Wed Jul 24 14:02:57 2013 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 241F427C; Wed, 24 Jul 2013 14:02:57 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id E3C022124; Wed, 24 Jul 2013 14:02:55 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id RAA22609; Wed, 24 Jul 2013 17:02:54 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1V1zeX-0008QC-Q4; Wed, 24 Jul 2013 17:02:53 +0300 Message-ID: <51EFDE3D.6020107@FreeBSD.org> Date: Wed, 24 Jul 2013 17:01:33 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130708 Thunderbird/17.0.7 MIME-Version: 1.0 To: Julian Elischer Subject: Re: rc.d support for zfs boot environments References: <51EFB254.8070807@FreeBSD.org> <51EFDCCC.4040205@freebsd.org> In-Reply-To: <51EFDCCC.4040205@freebsd.org> X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-fs@FreeBSD.org, freebsd-rc@FreeBSD.org X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.14 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, 24 Jul 2013 14:02:57 -0000 on 24/07/2013 16:55 Julian Elischer said the following: > On 7/24/13 6:54 PM, Andriy Gapon wrote: >> I would like to add another rc.d script or extend the current rc.d/zfs script >> for enhanced support of ZFS boot environments. > > isn't this what PC-BSD are working on? What is 'this' exactly? An rc script? In either case, I have no clue. -- Andriy Gapon From owner-freebsd-rc@FreeBSD.ORG Thu Jul 25 02:13:16 2013 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 25606B8F; Thu, 25 Jul 2013 02:13:16 +0000 (UTC) (envelope-from julian@elischer.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E7FE0260D; Thu, 25 Jul 2013 02:13:14 +0000 (UTC) Received: from jre-mbp.elischer.org (etroy.elischer.org [121.45.226.51]) (authenticated bits=0) by vps1.elischer.org (8.14.7/8.14.6) with ESMTP id r6P2D3Hl002024 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 24 Jul 2013 19:13:11 -0700 (PDT) (envelope-from julian@elischer.org) Message-ID: <51F089AB.4040505@elischer.org> Date: Thu, 25 Jul 2013 10:12:59 +0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: Andriy Gapon Subject: Re: rc.d support for zfs boot environments References: <51EFB254.8070807@FreeBSD.org> <51EFDCCC.4040205@freebsd.org> <51EFDE3D.6020107@FreeBSD.org> In-Reply-To: <51EFDE3D.6020107@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-fs@FreeBSD.org, freebsd-rc@FreeBSD.org, Julian Elischer X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.14 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, 25 Jul 2013 02:13:16 -0000 On 7/24/13 10:01 PM, Andriy Gapon wrote: > on 24/07/2013 16:55 Julian Elischer said the following: >> On 7/24/13 6:54 PM, Andriy Gapon wrote: >>> I would like to add another rc.d script or extend the current rc.d/zfs script >>> for enhanced support of ZFS boot environments. >> isn't this what PC-BSD are working on? > What is 'this' exactly? An rc script? > In either case, I have no clue. > I believe they are setting up an infrastructure to support ZFS boot environments, including rc components and such. From owner-freebsd-rc@FreeBSD.ORG Thu Jul 25 07:53:52 2013 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BF4FA112; Thu, 25 Jul 2013 07:53:52 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id A00972349; Thu, 25 Jul 2013 07:53:51 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id KAA04458; Thu, 25 Jul 2013 10:53:45 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1V2GMq-000Cl6-UZ; Thu, 25 Jul 2013 10:53:44 +0300 Message-ID: <51F0D963.8010000@FreeBSD.org> Date: Thu, 25 Jul 2013 10:53:07 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130708 Thunderbird/17.0.7 MIME-Version: 1.0 To: Julian Elischer Subject: Re: rc.d support for zfs boot environments References: <51EFB254.8070807@FreeBSD.org> <51EFDCCC.4040205@freebsd.org> <51EFDE3D.6020107@FreeBSD.org> <51F089AB.4040505@elischer.org> In-Reply-To: <51F089AB.4040505@elischer.org> X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: freebsd-fs@FreeBSD.org, freebsd-rc@FreeBSD.org, Julian Elischer X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.14 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, 25 Jul 2013 07:53:52 -0000 on 25/07/2013 05:12 Julian Elischer said the following: > On 7/24/13 10:01 PM, Andriy Gapon wrote: >> on 24/07/2013 16:55 Julian Elischer said the following: >>> On 7/24/13 6:54 PM, Andriy Gapon wrote: >>>> I would like to add another rc.d script or extend the current rc.d/zfs script >>>> for enhanced support of ZFS boot environments. >>> isn't this what PC-BSD are working on? >> What is 'this' exactly? An rc script? >> In either case, I have no clue. >> > I believe they are setting up an infrastructure to support ZFS boot > environments, including rc components and such. > Ah cool, I didn't know about that. There was a number of contributions from a number of people who made BEs quite usable and convenient already. I hope that iX will make FreeBSD BE support polished and "professional". So I hope that either they comment on the proposed patch or disclose some of their work to the FreeBSD community. -- Andriy Gapon