[Bug 1824236] Re: supermin/liguestfs fails to configure network
Eric Desrochers
eric.desrochers at canonical.com
Fri May 31 00:45:40 UTC 2019
Thanks Ioanna for providing a patch and work with upstream maintainer.
I have some concern that I want to address before talking about sponsorship.
I haven't tested libguestfs, so my observation are only base on the patch you have provided upstream, and my concern inside Ubuntu.
I would have prefer to see upstream adopting an approach based on
detecting if the host run 'Ubuntu' then apply the workaround, otherwise
don't apply it. Instead of deploying the workaround everywhere
regardless of the Linux distribution. IMHO, it would have look more
cleaner and less risky since the ubuntu workaround involve a remove file
operation. I would have prefer to isolate the 'rm' operation at the
maximum and limit it only when really needed.
Talking about this 'rm' operation[0], it deletes a 'dpkg-managed' file
part of systemd package[1]. It's a pretty critical package here, so you
would understand I'm taking this seriously. I'm afraid this could impact
user who benefit of this libguestfs workaround at next systemd package
upgrade if the file is absent for instance, and possibly break the next
pkg upgrade of systemd
Could you please verify that aspect ?
I'm also concern about what could be other potential impact in the absence of this file.
Ideally, I would definitely prefer not allowing libguestfs to do such operation.
Can you think of another way to fix this ?
Feel free to share your thoughts and correct me If I miss something I should know about this change, but so far this is some of my concern looking again looking the patch.
[0] - rm -f /etc/dhcp/dhclient-enter-hooks.d/resolved
[1] - apt-file search /etc/dhcp/dhclient-enter-hooks.d/resolved
systemd: /etc/dhcp/dhclient-enter-hooks.d/resolved
Here's some changes to apply to the current debdiff
- The 'Eoan' version need to be changed from "1.40.2-2ubuntu1.1" to "1.40.2-2ubuntu2". Let's use "1.40.2-2ubuntu1.1" for Disco instead.
- Your quilt patch need to be rename from "appliance-Remove-etc-dhcp-dhclient-enter-hooks.d-res.patch" "0016-appliance-Remove-etc-dhcp-dhclient-enter-hooks.d-res.patch" to stay consistent with the already existing patch numeric ordering.
Regards,
Eric
--
You received this bug notification because you are a member of Ubuntu
Sponsors Team, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/1824236
Title:
supermin/liguestfs fails to configure network
Status in libguestfs package in Ubuntu:
In Progress
Status in supermin package in Ubuntu:
Invalid
Status in libguestfs source package in Bionic:
In Progress
Status in supermin source package in Bionic:
Invalid
Status in libguestfs source package in Cosmic:
In Progress
Status in supermin source package in Cosmic:
Invalid
Status in libguestfs source package in Disco:
In Progress
Status in supermin source package in Disco:
Invalid
Bug description:
[Impact]
libguestfs cannot configure network on Bionic onward.
This bug is a combination of libguestfs/supermin package and
/etc/dhcp/dhclient-enter-hooks.d/resolved script from systemd,
present on Bionic onward.
When supermin creates the appliance does chroot and executes its init script.
If networking is enabled init will call dhclient sript to configure the network.
On Bionic onward the make_resolv_conf function of dhclient_script is overwritten
in /etc/dhcp/dhclient-eneter-hooks.d/resolved which before exiting restarts
the systemd.resolved service.
However, this happening in chroot environment fails with
"System has not been booted with systemd as init system (PID 1). Can't operate."
and network is left unconfigured.
[Test Case]
$ sudo guestfish -a xenial-server-cloudimg-amd64-disk1.img --network -v << EOF
run
mount /dev/sda1 /
command 'apt update'
EOF
libguestfs: launch: program=guestfish
libguestfs: launch: version=1.36.13
libguestfs: launch: backend registered: unix
libguestfs: launch: backend registered: uml
libguestfs: launch: backend registered: libvirt
...
supermin: deleting initramfs files
supermin: chroot
Starting /init script ...
...
+ dhclient --version
+ dhclient eth0
System has not been booted with systemd as init system (PID 1). Can't operate.
...
commandrvf: apt update
WARNING: apt does not have a stable CLI interface. Use with caution in
scripts.
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial/InRelease Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-backports/InRelease Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/InRelease Temporary failure resolving 'security.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
...
[Regression Potential]
Minimal. The fix removes the /etc/dhcp/dhclient-eneter-hooks.d/resolved hook installed by systemd.
systemd is not used inside the appliance so it should not cause any regression.
[Other]
Affects B,C,D,E.
Upstream fix :
https://github.com/libguestfs/libguestfs/commit/2bb6be333e6347d3f18856627d8ad8e50b8e5427
Workaround
1) Assume that libguestfs is installed, if not :
$ sudo apt-get install libguestfs-tools
2) Move the base.tar.gz to a temp dir, extract and remove tarball
$ sudo mv /usr/lib/x86_64-linux-gnu/guestfs/supermin.d/base.tar.gz ~/tempdir/
$ cd ~/tempdir
$ sudo tar -xzvf base.tar.gz
$ sudo rm base.tar.gz
3) Remove the etc/dhcp/dhclient-enter-hooks.d/resolved file
$ sudo rm etc/dhcp/dhclient-enter-hooks.d/resolved
4) Create tarball again
$ sudo tar -czvf base.tar.gz etc
5) Move it back to installation dir
$ sudo mv base.tar.gz /usr/lib/x86_64-linux-gnu/guestfs/supermin.d/
6) Clean cache
$ sudo rm -rf /var/tmp/.guestfs*
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libguestfs/+bug/1824236/+subscriptions
More information about the Ubuntu-sponsors
mailing list