<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - hostnamectl set-hostname destroys /etc/machine-info"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=76102">76102</a>
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>systemd-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>hostnamectl set-hostname destroys /etc/machine-info
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>systemd-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>minor
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux (All)
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>brian.harrington@coreos.com
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>general
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>systemd
          </td>
        </tr></table>
      <p>
        <div>
        <pre>While doing some work in trying ensure hostnames get set correctly on CoreOS I
found that running hostnamectl set-hostname would destroy the file
/etc/machine-info.

In this case the hostname "host-10-0-0-7" is the hostname assigned via DHCP. 
The file /etc/machine-info was created by hand and the system was subsequently
rebooted.


[bharrington@leviathan-alticon-net coreos]$ ssh 192.168.1.202
Warning: Permanently added '192.168.1.202' (RSA) to the list of known hosts.
Last login: Thu Mar 13 00:55:57 UTC 2014 from 192.168.1.63 on pts/1
   ______                ____  _____
  / ____/___  ________  / __ \/ ___/
 / /   / __ \/ ___/ _ \/ / / /\__ \
/ /___/ /_/ / /  /  __/ /_/ /___/ /
\____/\____/_/   \___/\____//____/
core@host-10-0-0-7 ~ $ 
core@host-10-0-0-7 ~ $ 
core@host-10-0-0-7 ~ $ 
core@host-10-0-0-7 ~ $ cat /etc/machine-info 
PRETTY_HOSTNAME=coreos-2.coreos.lab
core@host-10-0-0-7 ~ $ sudo hostnamectl set-hostname coreos-1.coreos.lab
core@host-10-0-0-7 ~ $ cat /etc/machine-info 
cat: /etc/machine-info: No such file or directory
core@host-10-0-0-7 ~ $ hostname
coreos-1.coreos.lab
core@host-10-0-0-7 ~ $ cat /etc/hostname 
coreos-1.coreos.lab</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>