From owner-freebsd-rc@FreeBSD.ORG Tue Feb 7 10:58:18 2012 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 843E010656AE for ; Tue, 7 Feb 2012 10:58:18 +0000 (UTC) (envelope-from se@freebsd.org) Received: from nm11.bullet.mail.sp2.yahoo.com (nm11.bullet.mail.sp2.yahoo.com [98.139.91.81]) by mx1.freebsd.org (Postfix) with SMTP id 62B2B8FC1B for ; Tue, 7 Feb 2012 10:58:18 +0000 (UTC) Received: from [98.139.91.62] by nm11.bullet.mail.sp2.yahoo.com with NNFMP; 07 Feb 2012 10:45:25 -0000 Received: from [208.71.42.202] by tm2.bullet.mail.sp2.yahoo.com with NNFMP; 07 Feb 2012 10:45:25 -0000 Received: from [127.0.0.1] by smtp213.mail.gq1.yahoo.com with NNFMP; 07 Feb 2012 10:45:25 -0000 X-Yahoo-Newman-Id: 430501.33179.bm@smtp213.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: WVPNTP4VM1mjgMjXYdQlcZ5gbTUGpmUWzRw6f6ZB1Q_VbYe MNUJhQadXsijBBZ0uO_eVcG4LhHkQRbuvg9av1t2mM78D6OXtn7KCtUizArV N6vJZLWA.1Xka126v19qMa.Wj3ScBuWtcHGeyztKhyXCidteBx6Cx1NpYzIz bOZwN_01WqEbRayuAjzn0QWcU9ec7xrWA3AI0xcEt8eYx.A5vh.6rguhgBzH pYeVu8YLo0M_GhmSiaqaCfGkPUoPSjvxavRyyT2EFtiWArYYJX8fp3FC4Jed BL_LN_af1SpUT4EfNF2AHYs5yNdffktNwHhIqouaOlnvgGDk.2kOKaaMMGVt RgV5Oj1dA7SdsSJOp5RarJxXl9XpNvLVXzjCKzO23Zx83LvqoiDcFpYMaedR mrKOi0NDszz6Q6P.izzMut8ozTPb87fYHQd16YkzZiCKabA7GkdXPW7z5yTn 2tGFgUOlhpkBuck8i7vQ- X-Yahoo-SMTP: iDf2N9.swBDAhYEh7VHfpgq0lnq. Received: from [192.168.119.22] (se@81.173.147.65 with plain) by smtp213.mail.gq1.yahoo.com with SMTP; 07 Feb 2012 02:45:24 -0800 PST Message-ID: <4F3100C3.4040700@freebsd.org> Date: Tue, 07 Feb 2012 11:45:23 +0100 From: Stefan Esser User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0) Gecko/20120129 Thunderbird/10.0 MIME-Version: 1.0 To: Hiroki Sato References: <4F2F3459.3090401@erdgeist.org> <20120206.114622.2214566196455293098.hrs@allbsd.org> <4F2FBAE4.1090901@freebsd.org> <20120207.063843.67168667989898285.hrs@allbsd.org> In-Reply-To: <20120207.063843.67168667989898285.hrs@allbsd.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-rc@FreeBSD.org Subject: Re: Proposal ipv6_addrs_common X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 10:58:18 -0000 Am 06.02.2012 22:38, schrieb Hiroki Sato: > Stefan Esser wrote > in <4F2FBAE4.1090901@freebsd.org>: > > se> Am 06.02.2012 03:46, schrieb Hiroki Sato: > se> > Yes, I agree that aliasN is fragile and renumbering is annoying. I > se> > am using a patch to allow the following syntax for a while: > se> > > se> > ifconfig_tap0_aliases=" > se> > inet6 2001:db8:8888:2::1/64 > se> > inet6 2001:db8:9990-9999:3::1/64 > se> > inet 10.8.1.1/24 > se> > inet 10.8.0.1-10/24 > se> > " > se> > se> I like this, but it does not seem to be compatible with David Teske's > se> sysrc script. And even though that script has not been made part of > > I tried sysrc for a variable with multiple lines, but it looks > working. What is the compatibility issue more specifically? Sorry, I had just assumed that it did not work, while in fact sysrc deals with multi-line values just fine. > se> A general syntax for this purpose is useful, but I'd rather not see > se> new-lines used for this purpose. For example, I have used "sort" to > se> prepare rc.conf files from different hosts for easy comparison with > se> each other. This will be broken, if entries cover more than one line. > se> There may be other breakage of that kind. > se> > se> So please choose a separator character that keeps lines intact ... > > Hmm, sorting rc.conf does not work in many cases because it can > contains shell script statements other than variable definitions. I > am using a for loop to define multiple vlan interfaces, for example. > If we need a feature for comparison, some kind of normalization to > extract variables and their values is needed just like sysrc does. Sorting works just fine for this purpose, at least on my rc.conf files. But I do not use loops or other control structures, just simple variable initializations in them. And I do not use the sorted file as actual rc.conf file, just look for differences between files. A utility that compares rc.conf files might be very useful and I think that should be a valuable addition to sysrc. E.g. a function to compare /etc./rc.conf with a template file, to compare two rc.conf files and to list differences in diff style, or to "grep" lines selected by a template file out of rc.conf, etc. > I admit 1-line-for-1-variable would be simple and that is a way we > have used and expected and I will not rush into an idea with multiple > lines. However, it is also true that enumeration like aliasN, > more-or-less caused by the 1-line policy, has caused annoying issues > and created similar knobs whose functionality is almost the same as > each other. IMHO the semantics of rc.conf files should not be complicated by multi-line entries. Any other separator would be preferable, IMO. > I will try to create another patch to support a separator other than > a newline, anyway. Dirk Engling suggested to use white space as separator and to interpret "inet" and "inet6" as (optional) AF indicators. I like this idea a lot! You could omit inet/inet6 for all numeric addresses (any parameter with a colon is an IPv6 address) and just use inet/inet6 if an address is specified by name (e.g. a host name that can be resolved during system start and for which IPv4 and IPv6 addresses exist, e.g. in /etc/hosts). Such a syntax would restrict use of ip*_addrs_common, but I think that's not a bug but a feature ;-) Regards, STefan