Subject: Bug#3507: named postinst mangled my configuration

From: Ian Jackson <[email-masked]>
Date: Wed, 3 Jul 96 22:36 BST

Package: bind
Version: 4.9.3-P1-3

> Setting up bind (4.9.3-P1-3) ...
> 
> [ conffiles prompts omitted ]
> Moving your /etc/named.boot to /var/named ...
> 
> Warning: Your named.boot file is being restructured to fit the Debian scheme
> for BIND configuration. The following files will be created as a result:
> 
>   /var/named/named.boot.old   - your original named.boot
>   /var/named/named.boot       - new file; should not be modified
>   /var/named/boot.options     - named options file; you may modify some
>   /var/named/boot.zones       - named zone configurations; you may modify all
> 
> It is recommended that you answer Y to the following question ...
> Rewrite /var/named/boot.options with a modified configuration? [Y] n

Aaaargh !

What if I don't like this funky layout ?  Surely this script should
ask me whether I want my universe rearranged ?!

It didn't even keep a backup !

Plus it reset the permissions on named.boot, which I'd made
group-writeable by group `root'.

> Configuration canceled. You can rerun `bindconfig' later if needed.
> 
> To be most effective, /etc/resolv.conf should list the IP address of your
> local machine (127.0.0.1) as a nameserver. You may want to change it now;
> answer the following question with a space-separated list of machine IP
> addresses to consult for name service.
> 
> Name server(s)? [127.0.0.1] 
> 
> You may also want to confirm other /etc/resolv.conf settings. See the
> resolv.conf(5) man page for details. Current contents:
> --------------------
> nameserver 127.0.0.1
> search chu.cam.ac.uk cus.cam.ac.uk cam.ac.uk cl.cam.ac.uk student-run.ucam.local ac.uk
> --------------------

I had all of this already - why does it feel the need to ask me
again ?  At least it gives me the old values as defaults.  Or at
least, I *think* those are the old values.

> Start name daemon now? [Y] 
> starting /usr/sbin/named ...

I had nicely set up my nameserver the way I liked it and this script
has eaten my configuration.  Just as well my tape drive was fixed so I
can find the old stuff in my backups ...

Ian.

---

From: Rob Leslie <[email-masked]>
Date: Fri, 05 Jul 1996 02:14:47 -0400

> ask me whether I want my universe rearranged ?!

For novice users, `bindconfig' depends on easily being able to modify parts of
your configuration; therefore, I have chosen this scheme. If you don't like
it, I won't stop you from rearranging things however you want. But before you
denounce the new arrangement, please first offer a fair critique.

> It didn't even keep a backup !

Backup of what? Is your original named.boot not saved in
/var/named/named.boot.old as advertised?

> group-writeable by group `root'.

Then you can reset them; the new files serve different purposes, and I will
not assume what permissions you will want to use for them, regardless of how
things were previously set up.

> least, I *think* those are the old values.

When configuring a name server it is not unusual to verify the local resolver
settings. And yes, unless you can prove otherwise, the old values should
indeed be given as defaults.

> can find the old stuff in my backups ...

Please explain. Is your name server's operation now defective as a result of
your upgrade?

Unless you can demonstrate a real bug here, I am going to close this report.

-- 
Robert Leslie
[email-masked]

---

From: Miquel van Smoorenburg <[email-masked]>
Date: Sat, 6 Jul 1996 10:34:35 +0200 (MET DST)

You (Rob Leslie) wrote:
> Ian Jackson wrote:

Happened to me too. /var/named/named.boot.old wasn't a backup, as I
had my named.boot in /etc and it was replaced by a symlink. Or the other way
around, I had it in /var/named and /etc/named.boot was a symlink to it.
Can't remember. I just make sure now I don't remove /var/named/boot.options
and an upgrade will think I have the new config in place while it's
just an empty file ;)

> Please explain. Is your name server's operation now defective as a result of

Yes every machine with a running named configuration where you install
the new one is truly fsck'ed up. A shame but it demonstrates again that
you can't go and put too much of your own preferences in a package.
People won't like it. OK OK I do it too with some of my own packages but so
far I've gotten away with it ;)

> Unless you can demonstrate a real bug here, I am going to close this report.

Well the config script could do the same thing as sendmail: ask if you
have a running configuration already and keep it that way _or_ convert
to a new setup.

The reason that you cannot convert this kind of stuff is that most people
already have it setup in some weird ways. For example, I have a master
Makefile in /var/named/Makefile, and the zone files in soa/ and rev/.
Those directories contain their own Makefiles. When I type "make" in
/var/named, changed zone files will have their serial number incremented
and the named server will be reloaded.

There's just no way a script is going to find out that layout and
replace it with a better one.

Mike.
-- 
  Miquel van    | Cistron Internet Services   --    Alphen aan den Rijn.
  Smoorenburg,  | mailto:[email-masked]          http://www.cistron.nl/
[email-masked] | Tel: +31-172-419445 (Voice) 430979 (Fax) 442580 (Data)

---

From: "James A. Robinson" <[email-masked]>
Date: Sun, 07 Jul 1996 02:18:43 -0400

> Happened to me too. /var/named/named.boot.old wasn't a backup, as I

The file is probably there, but the reason it is not in the expected
place is because the script is screwed up:

		[snip]
		if [ -e /etc/named.boot ]
		then
		  echo "Moving your /etc/named.boot to /var/named ..."
		  mv -f /etc/named.boot /var/named/.named.boot.old
		fi
		[snip]

It is sticking it into .named.boot.old, so it is a hidden file.

> had my named.boot in /etc and it was replaced by a symlink. Or the other way

I believe it probably moved it into the above location and then
created a symlink to the new named.boot it wrote.

> > Unless you can demonstrate a real bug here, I am going to close this report

I believe a bug has been demonstrated. :)

> have a running configuration already and keep it that way _or_ convert

I agree.  I nearly had a heart attack after going through a similar
experience.  I was upgrading a perfectly fine working setup because I
did a dselect upgrade.  There was no reason for me to change my setup.

I think it should have given me the choice (like dpkg does with
conffiles, or smailconfig does -- if it is not what bind setup in the
first place, check things out and ask).  I happen to like the new
layout just fine, but I would be happier if the script asked
permission. :)

Jim

---

From: Mark Eichin <[email-masked]>
Date: 09 Jul 1996 13:33:20 -0400

> and the named server will be reloaded.

Could you send me those bits of makefile? My biggest problem with the
zone I maintain is forgetting to update the serial numbers :-) Thanks...

---

From: Ian Jackson <[email-masked]>
Date: Tue, 9 Jul 96 22:38 BST

Rob Leslie writes ("Re: Bug#3507: named postinst mangled my configuration"):
...
> denounce the new arrangement, please first offer a fair critique.

But you *have* stopped me from arranging things how I want - your
script rearranges it, without asking me first !

> /var/named/named.boot.old as advertised?

No, it wasn't.  Not in .named.boot.old (with a .) either.

> things were previously set up.

Surely you should assume that I've set them up the way I want them,
not not trample all over everything ?!!

...
> indeed be given as defaults.

But my nameserver was *already configured* ?  Why does it feel the
need to rewrite my /etc/resolv.conf when I already had a perfectly
good one ?

> Please explain. Is your name server's operation now defective as a result of

I don't know whether it was defective in between your script
rearranging my configuration and me putting everything back.

After I had restored an old named.boot from backup, and then re-edited
it to take account of a recent change, it was not defective.

> Unless you can demonstrate a real bug here, I am going to close this report.

I think chopping to pieces my carefully set up configuration is
definitely a bug, and I'm quite prepared to go to war about this.  If
you've closed the bug I'll reopen it.

I was totally astonished at the messages coming out of the script, and
I thought `no, this can't be true, surely it's just broken messages',
but your script had actually decided to slice and dice my perfectly
happy setup !

Ian.

---

From: Rob Leslie <[email-masked]>
Date: Tue, 09 Jul 1996 18:33:59 -0400

Ian Jackson wrote:

>> For novice users, `bindconfig' depends on easily being able to modify parts
>> of your configuration; therefore, I have chosen this scheme. If you don't
>> like it, I won't stop you from rearranging things however you want. But
>> before you denounce the new arrangement, please first offer a fair
>> critique.
> 

Very well, I agree the script can be made to ask before modifying one's
configuration.

> No, it wasn't.  Not in .named.boot.old (with a .) either.

I don't really understand how this is possible...

> not not trample all over everything ?!!

No, I will not assume anything. However, I have already agreed that the
package could at least ask first.

>> When configuring a name server it is not unusual to verify the local
>> resolver settings. And yes, unless you can prove otherwise, the old values
>> should indeed be given as defaults.
> 

Where did that perfectly good resolv.conf come from?

>> Please explain. Is your name server's operation now defective as a result
>> of your upgrade?
> 

So you didn't take the time to see if the new configuration arrangement was
perfectly usable, if not perhaps even superior to the arrangement you had?

> you've closed the bug I'll reopen it.

Ian, I know war is probably what you would prefer, but I would rather discuss
this rationally. If it can't be done rationally, I will most happily
surrender, giving up this and most of my other Debian packages. I donate my
spare time to this project, and I don't appreciate the kind of abrasive tone
that permeates your bug report.

> but your script had actually decided to slice and dice my perfectly

Again, your previous configuration should have been saved in
/var/named/named.boot.old; if not, this is certainly a bug. Can you be
absolutely sure this file did not exist, despite your obvious panic over the
situation?

-- 
Robert Leslie
[email-masked]

---

From: Mark Eichin <[email-masked]>
Date: 11 Jul 1996 16:27:17 -0400

I'd just like to toss in a plea for having the named package ask
first, and handle the case of the existing configuration being
"perfectly good"... because I want a common config management among
linux and *non-linux* boxes, and bindconfig isn't available for them :-)

Seriously, for novice users it looks wonderful (and it Does The Right
Thing for my laptop, for example) but I don't want to have to verify
that my primary DNS hasn't lost track of something subtle after
upgrading to a compatible named release.

(I'm still running an old binary because of my patches to make
getiptos() not fatal on a 1.2.13 machine -- I haven't scheduled the
down time for the 2.0 upgrade yet, and there was no way it was going
to run 1.3.* :-)

---

From: Ian Jackson <[email-masked]>
Date: Tue, 16 Jul 96 02:01 BST

> Very well, I agree the script can be made to ask before modifying one's

Thanks.

...
> I don't really understand how this is possible...

Well, there was a named.boot.old, but the timestamp indicated that it
was much older than it ought to have been.  It looks like it might
have been from a previous package installation attempt.

> Where did that perfectly good resolv.conf come from?

I wrote it, when I configured my nameserver and stuff by hand back in
the mists of time ...

...
> perfectly usable, if not perhaps even superior to the arrangement you had?

No, because my nameserver has to work correctly.  It is a secondary
for debian.org, a primary for several local unofficial zones, and acts
as a resolver for several local systems.  I can't afford for it to be
acting incorrectly.

Furthermore, I think the `my setup is better than your setup' attitude
is very rude, especially when it comes from a program.  I should be
allowed to have my own setup.

...
> Ian, I know war is probably what you would prefer, [...]

I apologise for my comment about war.  I don't prefer it.

> absolutely sure this file did not exist, despite your obvious panic over the

It did exist, but its timestamp was wrong and the contents didn't look
plausible.  Admittedly the messages from the script had thrown me into
a panic so I can't be 100% certain that it wasn't a backup, but I
think that messages that throw reasonably experienced sysadmins into
panics are a bad thing ...

Ian.