named-bootconf.pl

Kevin Darcy kcd at daimlerchrysler.com
Wed May 2 01:11:41 UTC 2001


Mark.Andrews at nominum.com wrote:

> >
> > Greetings,
> >
> > On Tue, 1 May 2001, Bob Villa wrote:
> >
> > > How do you use this file.  I have run "perl named-bootconf.pl
> > > named.boot" but this creates no output file.

Bob, what version of named-bootconf.pl are you using? The version that comes
with BIND 8.2.3 uses Perl's "while(<>)" construct, which will read either from
the file(s) passed as command-line arguments, or, if none, from stdin. So it
should have worked the way that you invoked it.

> > <RANT ON>
> >    This has been a pet peeve of mine.  I am of the belief that a script
> > should TELL the user the correct syntax of the commands it expects or
> > accepts...  The authors of named-bootconf.pl don't agree with me and think
> > everyone should be a programmer and read the source code... :-(
> > </RANT OFF>
>
>         No we don't.  We wrote a man page.  Documented its use in README
>         with a example.
>
>         named-bootconf.pl has long ago been replaced with a shell script.

And the shell-script version does *not* have the same flexibility as the Perl
version, as described above. It *only* accepts stdin. This is a step backward
in usability, IMO.

>         Note it is a little hard to make it give a error message when it
>         is invoked correctly (no arguements is correct), even it it is not
>         being used correctly.

If the utility worked _either_ from stdin _or_ from files specified on the
command-line, the presence or absence of an error message would be a moot
point. But, at the very least, if no command-line arguments are expected, why
not just emit an error message (on stderr, to avoid corrupting stdout) if one
or more is given? Something like "unexpected argument '/etc/named.boot'. Usage:
named-bootconf < named.boot > named.conf". At least then the user could more
easily figure out and correct their mistake.


- Kevin

> >
> >    You have to tell 'named-bootconf.pl' where the INPUT will come from and
> > where the OUTPUT belongs and what it will be called.  You do this with the
> > redirect options '<' and '>', that direct Standard Input and Standard
> > Output.  Here's how the command should look:
> >
> >   cd into the directory where 'named-bootconf.pl' resides, -OR- include
> > the full path to the command.
> >
> >
> >  /path-to-script/named-bootconf.pl < /etc/named.boot > /etc/named.conf
> >
> >
> >    This will read in '/etc/named.boot', process it, and write its output
> > to '/etc/named.conf'.
> >
> >    Hope this helps you (and others that have been tripped up by this).





More information about the bind-users mailing list