[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#949735: closed by Thomas Goirand <zigo@debian.org> (Re: Bug#949735: AWS Debian9 AMI: Problems with /etc/hosts when user-data set 'manage_etc_hosts: false')



Hi!

Well, yes it doesn't match my expectation but that's not the bigger issue here.

We're all used to have conf files with helping comments and default
options commented out. Therefore we trust the information in the file.
In this case the information is misleading.

The first garbage, "Your system has configured 'manage_etc_hosts' as
True", make me very confused since I trust the information.
I immediately start debugging my system -- only to realize that I've done
nothing wrong, but the message was just garbage from the original AMI.


Hence, I think this ticket should be re-opened and at least Action 1 be
resolved.


New Action 1:
Make the header say "Your system has configured 'manage_etc_hosts' as
False. Therefore this file is not managed by cloud-init." or something
similar.

or

Make /etc/hosts contain only the bare minimum entries, i.e. the 127.0.0.1
and ::1.

or

empty the file completely


In any case, do not leave the garbage in there.

/Martin


27 jan. 2020 10:51 Debian Bug Tracking System <owner@bugs.debian.org>:
>
> This is an automatic notification regarding your Bug report
> which was filed against the cloud.debian.org package:
>
> #949735: AWS Debian9 AMI: Problems with /etc/hosts when user-data set 'manage_etc_hosts: false'
>
> It has been closed by Thomas Goirand <zigo@debian.org>.
>
> Their explanation is attached below along with your original report.
> If this explanation is unsatisfactory and you have not received a
> better one in a separate message then please contact Thomas Goirand <zigo@debian.org> by
> replying to this email.
>
>
> --
> 949735: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=949735
> Debian Bug Tracking System
> Contact owner@bugs.debian.org with problems
>
>
>
> ---------- Forwarded message ----------
> From: Thomas Goirand <zigo@debian.org>
> To: Martin Olsson <martin.olsson+debian@sentorsecurity.com>, 949735-done@bugs.debian.org
> Cc:
> Bcc:
> Date: Mon, 27 Jan 2020 10:40:06 +0100
> Subject: Re: Bug#949735: AWS Debian9 AMI: Problems with /etc/hosts when user-data set 'manage_etc_hosts: false'
> On 1/24/20 11:51 AM, Martin Olsson wrote:
> > Action 1:
> > Please make the header state "Your system has configured
> > 'manage_etc_hosts' as False.
> > Therefore this file is not managed by cloud-init." or something similar.
> >
> > Action 2:
> > Please remove this line. Or actually, see 3) below.
> >
> > Action 3:
> > If 'manage_etc_hosts' is set to "false", do a one-time write to
> > /etc/hosts, setting the fqdn and hostname to 127.0.0.1.
> > Only do this the first time the EC2 is booted. After that, the file is
> > managed manually.
>
> Hi,
>
> So, basically, you're complaining that when you set manage_etc_hosts:
> false, you're getting a /etc/hosts that doesn't match your expectation.
> Well, that is exactly what the feature is about... I guess then, you're
> suppose to edit /etc/hosts by hand, and fix it the way it pleases you.
>
> Then you're talking about is features to add to cloud-init upstream.
> Feel free to get in touch with them, or contribute the code. As it
> stands, I don't think anyone from the Debian cloud team feels like
> patching cloud-init to do what you're suggesting.
>
> Usually, the normal way to use the cloud is to *not* set
> manage_etc_hosts and let cloud-init do it, then maybe after the first
> boot, change the value.
>
> I'm closing this bug, because I really don't see how we should address
> it in a reasonable way.
>
> Cheers,
>
> Thomas Goirand
>
>
> ---------- Forwarded message ----------
> From: Martin Olsson <martin.olsson+debian@sentorsecurity.com>
> To: submit@bugs.debian.org
> Cc:
> Bcc:
> Date: Fri, 24 Jan 2020 11:51:33 +0100
> Subject: AWS Debian9 AMI: Problems with /etc/hosts when user-data set 'manage_etc_hosts: false'
> Package: cloud.debian.org
>
> I setup an EC2 in AWS using the Debian 9 AMI.
> I pass along this user-data:
> cat /var/lib/cloud/instance/user-data.txt
> #cloud-config
> fqdn: foo.bar.cloud
> timezone: Europe/Stockholm
> manage_etc_hosts: false
> ssh_authorized_keys:
>   - ssh-rsa AAAA...
>
> Sure enough, /etc/hosts is not managed. But...
>
> 1)
> The created /etc/hosts file give confusing and conflicting information.
> It says:
> # Your system has configured 'manage_etc_hosts' as True.
> # As a result, if you wish for changes to this file to persist
> # then you will need to either
> # a.) make changes to the master file in /etc/cloud/templates/hosts.tmpl
> # b.) change or remove the value of 'manage_etc_hosts' in
> #     /etc/cloud/cloud.cfg or cloud-config from user-data
>
> This is wrong. I have configured it as 'false'.
> I guess this erroneous information come from some default /etc/hosts
> template in your AMI.
>
> Action 1:
> Please make the header state "Your system has configured
> 'manage_etc_hosts' as False.
> Therefore this file is not managed by cloud-init." or something similar.
>
>
> 2)
> The created /etc/hosts file contain wrong IP information.
> It says:
> 127.0.1.1       ip-10-0-3-4.ec2.internal        ip-10-0-3-4
>
> This is wrong. My EC2 don't have this IP. In case I do use the subnet
> 10.0.3.0/24, this line would confuse me since I'm not the one who
> added it.
> Again, I guess this is left-overs from some default /etc/hosts
> template in your AMI (you probably used IP 10.0.3.4 when creating the
> AMI).
>
> Action 2:
> Please remove this line. Or actually, see 3) below.
>
>
> 3)
> Even if I set 'manage_etc_hosts: false' I would still like the
> installed Debian EC2 machine to get an /etc/hosts similar to
> a manually installed Debian machine, using netinst or CD1.
> That is, I don't want /etc/hosts to be *managed* over time (after
> reboots), but I *do* want the initial /etc/hosts to get the line
> 127.0.0.1       <fqdn>       <hostname>
> 127.0.0.1       localhost
> ...just like the normal debian-installer would do.
>
> Action 3:
> If 'manage_etc_hosts' is set to "false", do a one-time write to
> /etc/hosts, setting the fqdn and hostname to 127.0.0.1.
> Only do this the first time the EC2 is booted. After that, the file is
> managed manually.


Reply to: