Public bug reported:
In some images, centos/8/cloud image in LXD for example, there is not
hostname binary and cloud-init expects to have the hostname binary
present. The centos/8/cloud image does have hostnamectl which has a
--set-hostname parameter which can be used instead.
% lxc launch images:centos/8/cloud c8cloud
Creating c8cloud
Starting c8cloud
(neipa) ~ % lxc exec c8cloud bash
[root@c8cloud ~]# cloud-init status
status: error
[root@c8cloud ~]# cloud-init status --long
status: error
time: Sun, 08 Mar 2020 19:00:25 +0000
detail:
('update_hostname', ProcessExecutionError("Unexpected error while running
command.\nCommand: ['hostname']\nExit code: -\nReason: [Errno 2] No such file
or directory: b'hostname': b'hostname'\nStdout: -\nStderr: -",))
('mounts', FileNotFoundError(2, 'No such file or directory'))
('set-passwords', ProcessExecutionError("Unexpected error while running
command.\nCommand: ['service', 'sshd', 'restart']\nExit code: 5\nReason:
-\nStdout: \nStderr: Redirecting to /bin/systemctl restart sshd.service\n
Failed to restart sshd.service: Unit sshd.service not found.",))
** Affects: cloud-init (Ubuntu)
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1866562
Title:
cloud-init should also try to use hostnamectl --set-hostname if
hostname binary not present
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/1866562/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs