and, in fact, that *is* ok: $ cat /etc/hostname; echo ; echo == # Created by cloud-init domU-12-31-39-02-10-6D ==
$ sudo hostname --file /etc/hostname; echo $?; echo "hostname=$(hostname)"; echo === 0 hostname=domU-12-31-39-02-10-6D === $ sudo hostname -b -F /etc/hostname; echo $?; echo "hostname=$(hostname)"; echo === 0 hostname=domU-12-31-39-02-10-6D === $ sudo hostname -F /etc/hostname; echo $?; echo "hostname=$(hostname)"; echo === 0 hostname=domU-12-31-39-02-10-6D ===
So something else must be reading that and setting the hostname.
cloud-init log shows: 2012-09-19 14:41:37,523 - util.py[DEBUG]: Writing to /var/lib/cloud/instances/i-7289b008/sem/config-set_hostname - wb: [420] 19 bytes 2012-09-19 14:41:37,531 - helpers.py[DEBUG]: Running config-set_hostname using lock (<FileLock using file '/var/lib/cloud/instances/i-7289b008/sem/config-set_hostname'>) 2012-09-19 14:41:37,531 - cc_set_hostname.py[DEBUG]: Setting hostname to domU-12-31-39-02-10-6D 2012-09-19 14:41:37,531 - util.py[DEBUG]: Writing to /etc/hostname - wb: [420] 46 bytes 2012-09-19 14:41:37,536 - debian.py[DEBUG]: Setting hostname to domU-12-31-39-02-10-6D 2012-09-19 14:41:37,536 - util.py[DEBUG]: Running command ['hostname', 'domU-12-31-39-02-10-6D'] with allowed return codes [0] (shell=False, capture=True)
so it sure looks like *it* is calling hostname corectly.
and, in fact, that *is* ok: 31-39-02- 10-6D
$ cat /etc/hostname; echo ; echo ==
# Created by cloud-init
domU-12-
==
$ sudo hostname --file /etc/hostname; echo $?; echo "hostname= $(hostname) "; echo === domU-12- 31-39-02- 10-6D $(hostname) "; echo === domU-12- 31-39-02- 10-6D $(hostname) "; echo === domU-12- 31-39-02- 10-6D
0
hostname=
===
$ sudo hostname -b -F /etc/hostname; echo $?; echo "hostname=
0
hostname=
===
$ sudo hostname -F /etc/hostname; echo $?; echo "hostname=
0
hostname=
===
So something else must be reading that and setting the hostname.
cloud-init log shows: cloud/instances /i-7289b008/ sem/config- set_hostname - wb: [420] 19 bytes cloud/instances /i-7289b008/ sem/config- set_hostname' >) hostname. py[DEBUG] : Setting hostname to domU-12- 31-39-02- 10-6D 31-39-02- 10-6D 31-39-02- 10-6D'] with allowed return codes [0] (shell=False, capture=True)
2012-09-19 14:41:37,523 - util.py[DEBUG]: Writing to /var/lib/
2012-09-19 14:41:37,531 - helpers.py[DEBUG]: Running config-set_hostname using lock (<FileLock using file '/var/lib/
2012-09-19 14:41:37,531 - cc_set_
2012-09-19 14:41:37,531 - util.py[DEBUG]: Writing to /etc/hostname - wb: [420] 46 bytes
2012-09-19 14:41:37,536 - debian.py[DEBUG]: Setting hostname to domU-12-
2012-09-19 14:41:37,536 - util.py[DEBUG]: Running command ['hostname', 'domU-12-
so it sure looks like *it* is calling hostname corectly.