From owner-freebsd-questions@FreeBSD.ORG Fri Apr 22 16:51:19 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F228F106566B; Fri, 22 Apr 2011 16:51:19 +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 B8D958FC12; Fri, 22 Apr 2011 16:51:19 +0000 (UTC) Received: from sbhfislrext02.fnfis.com ([192.168.249.140]) by SCSFISLTC02 (8.14.3/8.14.3) with ESMTP id p3MGpIXB022872; Fri, 22 Apr 2011 11:51:18 -0500 Received: from sbhfisltcgw01.FNFIS.COM (Not Verified[10.132.248.121]) by sbhfislrext02.fnfis.com with MailMarshal (v6, 5, 4, 7535) id ; Fri, 22 Apr 2011 11:51:16 -0500 Received: from SBHFISLTCGW04.FNFIS.COM ([10.132.248.123]) by sbhfisltcgw01.FNFIS.COM with Microsoft SMTPSVC(6.0.3790.4675); Fri, 22 Apr 2011 11:51:18 -0500 Received: from dtwin ([10.132.254.135]) by SBHFISLTCGW04.FNFIS.COM over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Fri, 22 Apr 2011 11:51:16 -0500 From: "Devin Teske" To: "'Alexander Best'" Date: Fri, 22 Apr 2011 09:50:50 -0700 Organization: Vicor, Inc. Message-ID: <039d01cc010d$73438830$59ca9890$@vicor.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AcwBCiNK12Cv/J8MR6udsBjVysi4FA== Content-Language: en-us X-OriginalArrivalTime: 22 Apr 2011 16:51:17.0746 (UTC) FILETIME=[7FD04520:01CC010D] Cc: freebsd-hackers@freebsd.org, freebsd-questions@freebsd.org, "'Teske, Devin'" Subject: dialog(1) changed in RELENG_9 (was RE: [UPDATE] host-setup(1): a dialog(1)-based utility for configuring FreeBSD) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2011 16:51:20 -0000 > -----Original Message----- > From: Alexander Best [mailto:arundel@freebsd.org] > Sent: Friday, April 22, 2011 8:42 AM > To: Devin Teske > Cc: freebsd-hackers@freebsd.org; freebsd-questions@freebsd.org; 'Teske, > Devin' > Subject: Re: [UPDATE] host-setup(1): a dialog(1)-based utility for configuring > FreeBSD > > On Fri Apr 22 11, Devin Teske wrote: > > > > > -----Original Message----- > > > From: Alexander Best [mailto:arundel@freebsd.org] > > > Sent: Friday, April 22, 2011 7:55 AM > > > To: Devin Teske > > > Cc: freebsd-hackers@freebsd.org; freebsd-questions@freebsd.org; > > > Teske, Devin > > > Subject: Re: [UPDATE] host-setup(1): a dialog(1)-based utility for > > > configuring FreeBSD > > > > > > On Thu Apr 21 11, Devin Teske wrote: > > > > Hi List Members! > > > > > > > > I'm proud to announce the first update to my host-setup utility (a > > > > dialog(1)-based host configurator for FreeBSD). The following > > > > changes > > > have been > > > > made: > > > > > > > > - fixed bug where /etc/resolv.conf would be created with 0600 > > > permissions > > > > - fixed bug when switching from one default gateway to NO default > > > gateway > > > > - fixed typo in the title of netmask prompt and ifconfig options > > > > dialog > > > > - fixed bug that prevented entry of netmask if no netmask is > > > > configured > > > > > > > > You can get the updated version here: > > > > > > > > http://druidbsd.sourceforge.net/download/host-setup.txt > > > > > > otaku% sudo ./host-setup.txt > > > User cancelled. > > > otaku% echo $? > > > 1 > > > otaku% > > > > Can you provide me with the output of "uname -spr"? > > FreeBSD 9.0-CURRENT amd64 I haven't yet had a chance to pull that one down and install it yet. Hopefully you can help me out with this one here. > > > > > It's working fine for me on FreeBSD 8.1-RELEASE i386. > > > > Where you're bombing out is line 2403: > > [ $retval -eq 0 ] || die "User cancelled." > > > > Functionally, that is testing the return status of dialog(1) for the > > initial menu. See if you can execute this (a rough approximation of > > the initial > > menu): > > > > dialog --clear --title foo --hline bar --menu abc 17 55 9 1 a 2 b 3 c > > 4 d 5 e X x 2> /tmp/dialog.menu.foo > > doesn't work. :( Bummer! We'll have to fix that. > > otaku% echo $? > 255 > otaku% cat /tmp/dialog.menu.foo > > Error: Unknown option --hline. > Use --help to list options. Aha! I think I remember seeing in the list a thread related to swapping out dialog(1) for something new. This must be it. > > > otaku% > > taku% whereis dialog > dialog: /usr/bin/dialog /usr/share/man/en.ISO8859-15/man1/dialog.1.gz > /usr/src/gnu/usr.bin/dialog > > otaku% /usr/bin/dialog > cdialog (ComeOn Dialog!) version 1.1-20100428 Copyright 2000-2007,2008 Thomas > E. Dickey This is free software; see the source for copying conditions. There is NO > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR > PURPOSE. I can't recall as I don't have the thread in front of me, but why was dialog(1) replaced with cdialog? licensing? performance? I guess I could code my script to support this new dialog(1), but... can you see if the below works (I removed the "--hline" option): dialog --clear --title foo --menu abc 17 55 9 1 a 2 b 3 c 4 d 5 e X x 2> /tmp/dialog.menu.foo If that succeeds, then I can modify my script to not use `--hline' on RELENG_9 and higher (referencing `sysctl -n kern.osreldate` for example). > > [...] > > > > > A menu should appear. Select an item and then execute for me: > > > > echo $? > > > > If the above doesn't work, then I suspect that your dialog(1) is not > > working properly. I'd then go and try this as a sanity check: > > > > cd /usr/share/examples/dialog > > otaku% cd /usr/share/examples/dialog > cd: no such file or directory: /usr/share/examples/dialog Really? I would have thought that the examples in that directory (which are merely shell scripts) would have been recoded for cdialog rather than altogether removed. Maybe there was licensing issues there too. Was there? > > > sh menubox > > echo $? > > > > The result in both cases (as long as you actually select a menu item) > > should be "0". > > > > Also... (just as a sanity check for me) your /bin/sh is not a symlink > > to bash is it? > > otaku% file /bin/sh > /bin/sh: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), dynamically > linked (uses shared libs), for FreeBSD 9.0 (900034), stripped Cool. Though I'm still disappointed that my beloved dialog(1) has gone missing (rather, replaced with something doesn't accept the same arguments and/or options)(which is the problem that we're experiencing here). Is there anybody familiar with the changing-out dialog(1) that can bring me up to speed with reasoning and specifics for RELENG_9? Also, might it be prudent -- before cutting 9_0_RELEASE -- to add the fact that dialog(1) no longer accepts `--hline' to the UPGRADING and/or ERRATA documents? -- Devin > > > -- > > Devin > > > > > > > > > > > or > > > > http://druidbsd.sourceforge.net/download/host-setup.gz > > > > or > > > > http://druidbsd.sourceforge.net/ > > > > > > > > For those not familiar with my host-setup(1) utility, it is a 2,500+ line shell > > > > script that utilizes the dialog(1) utility to walk the system administrator > > > > through setting up their TimeZone, Hostname, Network Interfaces, > > > > Default Gateway, and DNS. Our custom FreeBSD installer sets this > > > > script as the root login shell, making it very easy for field engineers to quickly > > > > get a system on the network without having to use the command-line (and > > > > without having to reboot either). Underneath the hood - behind the system > > > > of prompts and dialogs - this script manages both the contents of /etc/rc.conf, > > > > /etc/resolv.conf, and others as well as utilizing ifconfig(8), route(8), and many > > > > other tools to avoid requiring a reboot, prompting you if you would like to > > > > make the new changes effective when values are changed from their active > > > > settings. > > > > > > > > Here's the patch to show the details: > > > > > > > > [snip] > > > > -- > > > > Cheers, > > > > Devin Teske > > > > > > > > -> FUN STUFF <- > > > > -----BEGIN GEEK CODE BLOCK----- > > > > Version 3.12 > > > > GAT/CS/B/CC/E/IT/MC/M/MU/P/S/TW d+(++) s: a- C+++@$ UB++++$ P++++@$ L++++$ E- > > > > W+++ N? o? K? w@ O M++$ V- PS+>++ PE@ Y+ PGP-> t(+) 5? X(+) R(-) W+++ tv+ b+>++ DI+ > > > > D+(++) G++ e>++++ h r+++ z+++ > > > > ------END GEEK CODE BLOCK------ > > > > Learn about the "Geek Code": http://www.geekcode.com/ > > > > > > > > -> LEGAL DISCLAIMER <- > > > > This message contains confidential and proprietary information > > > > of the sender, and is intended only for the person(s) to whom it > > > > is addressed. Any use, distribution, copying or disclosure by any > > > > other person is strictly prohibited. If you have received this > > > > message in error, please notify the e-mail sender immediately, > > > > and delete the original message without making a copy. > > > > > > > > -> END TRANSMISSION <- > > > > _____________ > > > > > > > > The information contained in this message is proprietary and/or > > > confidential. If you are not the intended recipient, please: (i) > > > delete the message and all copies; (ii) do not disclose, distribute > > > or use the message in any manner; and (iii) notify the sender > > > immediately. In addition, please be aware that any message addressed > > > to our domain is subject to archiving and review by persons other > > > than the intended recipient. Thank you. > > > > _____________ > > > > > > -- > > > a13x > > > > _____________ > > > > The information contained in this message is proprietary and/or confidential. If > you are not the intended recipient, please: (i) delete the message and all copies; > (ii) do not disclose, distribute or use the message in any manner; and (iii) notify > the sender immediately. In addition, please be aware that any message > addressed to our domain is subject to archiving and review by persons other than > the intended recipient. Thank you. > > _____________ > > -- > a13x _____________ The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you. _____________