Hey Dan, For the FreeIPMI 1.2.5 release I fixed three things.
1) Fix the --filename option to work with --checkout (broke in a release long ago). 2) Clarify --filename option in config tool manpages (bmc-config, ipmi-pef-config, etc.). 3) On non-fatal errors, config tools exit with 1. On fatal errors now exit with 2. Admittedly I was a bit wary of doing #3 in a minor errata release. But given how I know most users use FreeIPMI, I don't think it'll be a big deal. I hope I'm right :P If you'd like to try it out, the SVN branch is this one: svn co svn://svn.savannah.gnu.org/freeipmi/branches/Release-1_2_0_branch ./autogen.sh ./configure Al On Tue, 2013-01-22 at 12:16 -0800, dan farmer wrote: > Al, thanks for the quick response. > > I got another off-list response pointing out my ancient version of freeipmi > (yum doesn't apparently upgrade much!), but I just checked the latest (1.24) > and my findings were repeated. > > I'm not sure what the right answer is here, but I'll describe a potential use > case; I'm investigating taking the output and run it through some basic > security/sanity checks (e.g. is cipher 0 enabled.) I suppose I could use the > -L option to query for sections, and then iterate the tool on each section. > Doing that is somewhat interesting: > > # for i in `bmc-config -L`; do > echo -n $i : > bmc-config --always-prefix -v --section=$i --checkout > /dev/null > echo $? > done > > User1 :1 > User2 :1 > User3 :1 > User4 :1 > User5 :1 > User6 :1 > User7 :1 > User8 :1 > User9 :1 > User10 :1 > Lan_Channel :0 > Lan_Conf :0 > Lan_Conf_Auth :0 > Lan_Conf_Security_Keys :0 > Lan_Conf_Misc :0 > Rmcpplus_Conf_Privilege :1 > SOL_Conf :0 > > Your suggestion of having a 1 or a 2 based on fatal or not would be quite > helpful to understand if there are any serious problems or not. > > And yes, I can obviously workaround the --prefix business by redirecting the > output into a file ;) > > dan > > ^..^ > > > > > On Jan 22, 2013, at 10:11 AM, Albert Chu <[email protected]> wrote: > > > Hey Dan, > > > > On Mon, 2013-01-21 at 12:59 -0800, dan farmer wrote: > >> First, thanks for the tool, I'd been doing individual grabs of config > >> values before, bleah! > >> > >> > >> Secondly, bmc-config returns 1 even if it succeeds pulling > >> configuration details (my sys-details at the bottom.) I suppose it's > >> possible that it returns non-zero when it gets an "Unable to checkout" > >> on a field, but that isn't even listed in the non -v output and is a > >> fraction of the output. I hope this is a bug, or there is an > >> alternate way to get an exit code, or else it makes running the tool > >> in an automated fashion really sucky (how can you know what worked?) > > > > I'll go back and look at this code some more. The exit code is > > generally considered to be non-zero if there is any checkout failure > > (fatal or non-fatal). However, that should probably be tweaked, b/c of > > how bmc-config has grown, it's probably impossible for all config > > checkouts to always succeed on any hardware out there. The exit codes > > should atleast be different (maybe 1 on fatal error, 2 on non-fatal > > error). > > > >> Thirdly, a small bug, or at least a consistency issue, with the > >> --filename output, which ignores the --always-prefix argument (the > >> first command prepends the host, the 2nd doesn't); the manpage says > >> under --always-prefix that the tool will "always prefix output" - is > >> this a problem with my system (details below), the tool, the man page, > >> or my understanding, or some combo of the same? :) > > > > This is probably a documentation mistake. B/c the output of bmc-config > > is supposed to be fed back into bmc-config, it's one of the FreeIPMI > > tools that shouldn't support the always-prefix option. I'll have to > > look into this more closely. > > > > But thanks for the bug report. Somewhere along the line --filename > > stopped working w/ --checkout. So I need to fix that in the upstream > > version (it's funny that no one noticed until now. Most probably pipe > > --checkout stdout to a file). > > > > Al > > > >> (Three runs of bmc-config, the first to show a valid exit code, then > >> the two with --filename and simple file redirect, then a diff to show > >> the lack of prefix) > >> > >> > >> # bmc-config --version > >> bmc-config - 0.7.16 > >> Copyright (C) 2003-2008 FreeIPMI Core Team > >> This program is free software; you may redistribute it under the terms > >> of > >> the GNU General Public License. This program has absolutely no > >> warranty. > >> [root@blackhol3 zen]# echo $? > >> 0 > >> > >> > >> # bmc-config --checkout --always-prefix > foo1 > >> > >> > >> # echo $? > >> 1 > >> > >> > >> # bmc-config --checkout --always-prefix --filename foo2 > >> > >> > >> # echo $? > >> 1 > >> > >> > >> > >> > >> # diff foo1 foo2 > >> 1,476c1,476 > >> < localhost: # > >> < localhost: # Section UserX Comments > >> < localhost: # > >> < localhost: # In the following User sections, users should > >> configure usernames, passwords, > >> [...] > >> > >> > >> System details it was tested on: > >> > >> > >> # bmc-config -V > >> bmc-config - 0.7.16 > >> Copyright (C) 2003-2008 FreeIPMI Core Team > >> This program is free software; you may redistribute it under > >> the terms of > >> the GNU General Public License. This program has absolutely > >> no warranty. > >> > >> > >> # uname -a > >> Linux blackhol3 3.5.4-3.el6xen.x86_64 #1 SMP Sat Sep 29 > >> 15:16:26 EST 2012 x86_64 x86_64 x86_64 GNU/Linux > >> > >> > >> # cat /etc/redhat-release > >> CentOS release 6.3 (Final) > >> > >> > >> # bash --version > >> GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu) > >> Copyright (C) 2009 Free Software Foundation, Inc. > >> License GPLv3+: GNU GPL version 3 or later > >> <http://gnu.org/licenses/gpl.html> > >> > >> > >> This is free software; you are free to change and redistribute > >> it. > >> There is NO WARRANTY, to the extent permitted by law. > >> > >> > >> Happy to answer any q's, etc., and thanks again. > >> > >> > >> dan > >> > >> ^..^ > >> > >> > >> > >> > >> > >> > >> > >> _______________________________________________ > >> Freeipmi-devel mailing list > >> [email protected] > >> https://lists.gnu.org/mailman/listinfo/freeipmi-devel > > -- > > Albert Chu > > [email protected] > > Computer Scientist > > High Performance Systems Division > > Lawrence Livermore National Laboratory > > > -- Albert Chu [email protected] Computer Scientist High Performance Systems Division Lawrence Livermore National Laboratory _______________________________________________ Freeipmi-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/freeipmi-devel
