From owner-freebsd-sysinstall@FreeBSD.ORG Mon Feb 13 07:10:41 2012 Return-Path: Delivered-To: freebsd-sysinstall@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A941106564A for ; Mon, 13 Feb 2012 07:10:41 +0000 (UTC) (envelope-from Devin.Teske@fisglobal.com) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) by mx1.freebsd.org (Postfix) with ESMTP id 13DFF8FC13 for ; Mon, 13 Feb 2012 07:10:40 +0000 (UTC) Received: from pps.filterd (ltcfislmsgpa04 [127.0.0.1]) by ltcfislmsgpa04.fnfis.com (8.14.4/8.14.4) with SMTP id q1D6nK8l022393; Mon, 13 Feb 2012 01:10:39 -0600 Received: from smtp.fisglobal.com ([10.132.206.15]) by ltcfislmsgpa04.fnfis.com with ESMTP id 12xtmh0jak-1 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Mon, 13 Feb 2012 01:10:39 -0600 Received: from [10.0.0.101] (10.14.152.24) by smtp.fisglobal.com (10.132.206.15) with Microsoft SMTP Server (TLS) id 14.1.323.3; Mon, 13 Feb 2012 01:10:37 -0600 MIME-Version: 1.0 (Apple Message framework v1084) From: Devin Teske In-Reply-To: <092FD6D4-5AC7-40D6-B060-12F09AACB5BE@fisglobal.com> Date: Sun, 12 Feb 2012 23:10:34 -0800 Message-ID: <5A383681-A8E7-4B2C-9176-602570F9A05F@fisglobal.com> References: <4F342066.2050409@fuzzwad.org> <07f501cce85b$4ac934f0$e05b9ed0$@fisglobal.com> <4F35C5E6.7010607@fuzzwad.org> <5FB150D7-BA30-406D-B8B1-5BDEF1909502@fisglobal.com> <4F35DEC0.2030904@fuzzwad.org> <092FD6D4-5AC7-40D6-B060-12F09AACB5BE@fisglobal.com> To: Devin Teske X-Mailer: Apple Mail (2.1084) X-Originating-IP: [10.14.152.24] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.6.7361, 1.0.260, 0.0.0000 definitions=2012-02-13_01:2012-02-10, 2012-02-13, 1970-01-01 signatures=0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Dave, Robison , Ron McDowell , freebsd-sysinstall@freebsd.org Subject: Re: Announcing bsdconfig(8) preliminary X-BeenThere: freebsd-sysinstall@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Sysinstall Work List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2012 07:10:41 -0000 On Feb 11, 2012, at 7:07 PM, Devin Teske wrote: >=20 > On Feb 11, 2012, at 5:23 PM, Devin Teske wrote: >=20 >>=20 >> On Feb 11, 2012, at 2:06 PM, Devin Teske wrote: >>=20 >>>=20 >>> On Feb 10, 2012, at 7:21 PM, Ron McDowell wrote: >>>=20 >>>> On 2/10/12 8:35 PM, Devin Teske wrote: >>>>> On Feb 10, 2012, at 5:35 PM, Ron McDowell wrote: >>>>>=20 >>>>>> On 2/10/12 7:20 PM, Devin Teske wrote: >>>>>>>> -----Original Message----- >>>>>>>> From: owner-freebsd-sysinstall@freebsd.org [mailto:owner-freebsd- >>>>>>>> sysinstall@freebsd.org] On Behalf Of Ron McDowell >>>>>>>> Sent: Thursday, February 09, 2012 11:37 AM >>>>>>>> To: freebsd-sysinstall@freebsd.org >>>>>>>> Subject: Announcing bsdconfig(8) preliminary >>>>>>>>=20 >>>>>>>> http://fuzzwad.org/bsdconfig/ is a long way from finished, but the= re is >>>>>>>> enough of a framework available now, that I'm wanting some feedbac= k on. >>>>>>>> Tarballs are out there and I'll guarantee you'll want to look at t= he >>>>>>>> latest, and not the earlier examples. The manpage in the tarball = is a >>>>>>>> good place to start. >>>>>>>>=20 >>>>>>>> Feel free to talk about it here and ask any questions you want. T= he >>>>>>>> direction I go with it will depend [I hope!] on where everyone wan= ts it >>>>>>>> to go. Thanks in advance. >>>>>>>>=20 >>>>>>> Hi Ron, >>>>>>>=20 >>>>>>> Thank you very much for working on this with everyone. >>>>>>>=20 >>>>>>> I notice that you've centralized the use of "notimplemented" to >>>>>>> /usr/libexec/bsdconfig/notimplemented which makes the per-module fi= les >>>>>>> /usr/libexec/bsdconfig/*.*/notimplemented obsolete. >>>>>>>=20 >>>>>>> I thinking I should clean things up after installation by executing: >>>>>>>=20 >>>>>>> cd /usr/libexec/bsdconfig >>>>>>> sudo rm -f *.*/notimplemented >>>>>> Absolutely, thanks for pointing that out. I just cleaned it up on m= y copy. >>>>>>=20 >>>>>>> Again, thanks for working on this, ... would you mind if I took it = and worked on >>>>>>> it this weekend and passed it back to you for review? >>>>>> Go for it! >>>>>>=20 >>>>> How do you feel about implementing "090.time-zone" with my ports addi= tion, sysutils/tzdialog? >>>>=20 >>>> tzsetup(8) is already installed in base...I haven't looked at tzdialog= , does it do more than tzsetup? If so, then tzdialog needs to be included h= ere like we've done with host-setup in 120.networking. >>>>=20 >>>>> Aside, I have a question about the INDEX file... >>>>>=20 >>>>> Does the exit status of the program-to-be-executed matter in any way = to bsdconfig? >>>>=20 >>>> Not yet, but it could and probably should...if nothing else, we should= at least pass the exit code back up the line. >>>>=20 >>>>> Reason I ask is because tzdialog has a "-e" flag which may be useful = if-desired, causing the exit status to be success if-and-only-if both a zon= efile is selected and it was installed without error. >>>>=20 >>>> --=20 >>>> Ron McDowell >>>> San Antonio TX >>>=20 >>> I've put a significant amount of work into this over the last 24 hours = and would like to share my contributions. >>>=20 >>> http://druidbsd.sourceforge.net/download/bsdconfig/ >>>=20 >>> http://druidbsd.sourceforge.net/download/bsdconfig/bsdconfig.120211.txz >>>=20 >>> Please try: >>>=20 >>> bsdconfig networking >>> bsdconfig timezone >>> bsdconfig networking -h >>> bsdconfig timezone -h >>> bsdconfig networking -X >>> bsdconfig timezone -X >>>=20 >>=20 >> Here's a little trick for testing the X11 interfaces from a Mac or PC (r= unning Windows) using X11 Forwarding over SSH to a FreeBSD 9 box as a non-r= oot user with sudo(8) access. >>=20 >=20 > [snip] >=20 >>=20 >> Step 3: Grant "root" the ability to use your X11 session >>=20 >> The default settings in FreeBSD 9 don't allow you to do things like: >>=20 >> sudo xdpyinfo >>=20 >> The failure becomes: >>=20 >> X11 connection rejected because of wrong authentication. >> xdpyinfo: unable to open display "localhost:10.0". >>=20=20 >> The solution is to execute: >>=20 >> xauth -f ~/.Xauthority extract - ${HOSTNAME:-localhost}{/unix,}:${DISPL= AY#*:} | sudo -u root xauth -ivf ~root/.Xauthority merge - >>=20 >=20 I've put a lot more work into bsdconfig over the past 24 hours and hand it = back off for review. http://druidbsd.sf.net/download/bsdconfig/ http://druidbsd.sf.net/download/bsdconfig/bsdconfig.120212.txz Changes include: both "networking" and "timezone" have had their common-bits removed and con= sequently some new includes are now available (detailed below): /usr/libexec/bsdconfig/incl/dialog.incl Provides the following functions for dealing with dialogs: - f_dialog_infobox_size() - f_dialog_buttonbox_size() - f_dialog_inputbox_size() - f_dialog_menu_size() - f_dialog_clear() - f_dialog_info() - f_xdialog_info() - f_dialog_msgbox() - f_dialog_yesno() - f_dialog_inputstr() - f_dialog_menutag() - f_dialog_menutag2item() - f_dialog_menutag2index() /usr/libexec/bsdconfig/incl/mustberoot.incl Upon inclusion will make sure that you are root. If you are not root, prompts for sudo(8) credentials. Script re-executes itself automatically via sudo(8). Preserves command-line arguments. /usr/libexec/bsdconfig/incl/strings.incl Provides the following functions for string manipulation and et cetera: - f_substr() - f_longest_line_length() - f_number_of_lines() /usr/libexec/bsdconfig/incl/sysrc.incl Provides the following functions for managing rc.conf(5) settings: - f_clean_env() - f_sysrc_get() - f_sysrc_find() - f_sysrc_set() - f_sysrc_delete() NOTE: The sysrc.incl module should make authoring the "startup" module pret= ty easy (compared to without it). I'm looking forward to writing that modul= e before next weekend. In addition, bsdconfig itself now uses the "mustberoot.incl" include, meani= ng that any of the following commands can now work as non-root (so long as = sudo(8) is installed and your account has access to use it; HINT: pkg_add -= r sudo && pw usermod myusername -G wheel). bsdconfig bsdconfig networking /usr/libexec/bsdconfig/120.networking/networking bsdconfig networking -X /usr/libexec/bsdconfig/120.networking/networking -X bsdconfig timezone /usr/libexec/bsdconfig/090.time-zone/timezone bsdconfig timezone -X /usr/libexec/bsdconfig/090.time-zone/timezone -X eliminating the need to either (a) use sudo(8) or (b) use su(1) to become r= oot first. All the above commands will work as non-root user if sudo(8) is = installed and the current user is granted access. NOTE: The "-X" options now automatically work via SSH as I've incorporated = the xauth(1) session management into the "mustberoot.incl" include (auto-en= ables if-and-only-if both $SSH_CONNECTION and $DISPLAY are set). Other changes include - expanding the f_die() function in the "common.incl" include to take a pri= ntf(1) syntax. - optimized bsdconfig INDEX scanning for usage statement (changed a "cat | = grep | sed | sed" into a single "awk") - cleaned up "networking" further (formerly "host-setup" from ports tree in= sysutils), removing "reset_shell" and ilk That's all for now. Zzzzz... --=20 Devin P.S. Breakdown of activity over this weekend: dteske@push900.vicor.com ~ $ diff -rupN bsdconfig.1202{09,11} | wc -l 9946 dteske@push900.vicor.com ~ $ diff -rupN bsdconfig.1202{11,12} | wc -l 4840 _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you.