the system does not ignore comments in /etc/hostname

Bug #1053048 reported by Scott Moser
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
systemd (Ubuntu)
Fix Released
Medium
Martin Pitt

Bug Description

As found at bug 1052664

$ dpkg-query --show network-manager
network-manager 0.9.6.0-0ubuntu7

$ cat /etc/hostname
# xxxxxxx by cloud-init
domU-12-31-39-0C-6C-81

This *should* be ok, as per 'man hostname':
       -F, --file filename
              Read the host name from the specified file. Comments (lines
              starting with a `#') are ignored.

However, network-manager does not ignore the comments.

Tags: quantal
Thomas Hood (jdthood)
description: updated
summary: - network-manager does not respect comments in /etc/hostname
+ network-manager does not ignore comments in /etc/hostname
Changed in network-manager (Ubuntu):
status: New → Triaged
importance: Undecided → High
assignee: nobody → Mathieu Trudel-Lapierre (mathieu-tl)
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote : Re: network-manager does not ignore comments in /etc/hostname

Does this currently really affect anyone? I'm tempted to only release this as SRU, depending on whether I find anything else to upload with this before Final Freeze.

Changed in network-manager (Ubuntu):
status: Triaged → In Progress
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Candidate for SRU...

Changed in network-manager (Ubuntu):
status: In Progress → Triaged
Changed in network-manager (Ubuntu Quantal):
status: In Progress → Triaged
Revision history for this message
Rolf Leggewie (r0lf) wrote :

quantal has seen the end of its life and is no longer receiving any updates. Marking the quantal task for this ticket as "Won't Fix".

Changed in network-manager (Ubuntu Quantal):
status: Triaged → Won't Fix
Ken Sharp (kennybobs)
tags: added: quantal
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Closing the NM task as Invalid and opening one for systemd. NM uses gethostname() (at least, in vivid), which should be returning the right value.

Here if I reproduce the issue by adding a comment in /etc/hostname, I get the hostname set very early at boot, much before NetworkManager is started.

no longer affects: systemd (Ubuntu Quantal)
Changed in network-manager (Ubuntu):
status: Triaged → Invalid
Changed in systemd (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
Changed in network-manager (Ubuntu):
assignee: Mathieu Trudel-Lapierre (mathieu-tl) → nobody
Changed in network-manager (Ubuntu Quantal):
assignee: Mathieu Trudel-Lapierre (mathieu-tl) → nobody
summary: - network-manager does not ignore comments in /etc/hostname
+ the system does not ignore comments in /etc/hostname
Revision history for this message
Martin Pitt (pitti) wrote :

/etc/hostname is not specified to accept comments, lowering severity.

Changed in systemd (Ubuntu):
status: Confirmed → Triaged
importance: Medium → Wishlist
Revision history for this message
Martin Pitt (pitti) wrote :

Ah, seems man 1 hostname and man 5 hostname contradict here..

Changed in systemd (Ubuntu):
importance: Wishlist → Medium
Revision history for this message
Martin Pitt (pitti) wrote :
Changed in systemd (Ubuntu):
assignee: nobody → Martin Pitt (pitti)
importance: Medium → Wishlist
status: Triaged → In Progress
no longer affects: network-manager (Ubuntu)
no longer affects: network-manager (Ubuntu Quantal)
Revision history for this message
Martin Pitt (pitti) wrote :

I fixed this upstream: http://cgit.freedesktop.org/systemd/systemd/commit/?id=139e5336286

This depends on a couple of previous patches, so not that easy to cherry-pick. If this is urgent/necessary for vivid, I'd apply the original patch http://lists.freedesktop.org/archives/systemd-devel/2015-May/031925.html which was inferior, but backports better.

Changed in systemd (Ubuntu):
status: In Progress → Fix Committed
importance: Wishlist → Medium
Revision history for this message
Martin Pitt (pitti) wrote :

This was fixed in https://launchpad.net/ubuntu/+source/systemd/220-6ubuntu1, I just typo'ed the bug ref in the changelog.

Changed in systemd (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.