> I don't believe your reproducer is valid - cloud-init is not installed
anymore, as autopkgtest-buildvm-ubuntu-cloud removes it when building
the VM, whereas it remains on the cloud images, as it's needed there to
actually get the IP address during boot.

Note, in
https://bugs.launchpad.net/ubuntu/+source/ufw/+bug/1950039/comments/9 I
installed cloud-init and did some analysis also (but see below).

> Though arguably I'd expect this to be fixed by removing
DefaultDependencies again, if I looked at this correctly.

Seems likely, though this change was done to fix an issue people were
seeing on stack exchange for Debian/Ubuntu systems related to a race
between encrypted filesystems and ufw. I guess I could add back
DefaultDependencies=no and add After=local-fs.target, but I'm not sure
what this would do in practice since local-fs.target is so close to the
end of sysinit anyway (but see below).

In 0.36.1-2, ufw has:
DefaultDependencies=no
Before=network.target

In 0.36.1-3, ufw has (no DefaultDependencies=no):
Before=network-pre.target
Wants=network-pre.target

cloud-init has (among other things):
Before=sysinit.target
Before=network-pre.target
Wants=network-pre.target

AIUI, with 0.36.1-2, ufw will tend to start right away due to
DefaultDependencies=no and so will cloud-init so long as it finishes
before sysinit. ufw need only finish before network.target, which is
after network-pre.target. Eg, ufw and cloud-init race to complete but
otherwise their dependencies directly don't affect each other.

With 0.36.1-3, cloud-init starts early and before ufw since it must
finish before sysinit.target and ufw cannot start until after
sysinit.target is done. Because both must finish before network-
pre.target, this pushes network-pre.target after sysinit (and of course,
ufw), but other than that, there shouldn't be a problem since we have:

 1. cloud-init starts / finishes
 2. sysinit starts / finishes
 3. ufw starts / finishes
 4. network-pre reached
 5. systemd-networkd starts / finishes
 6. network reached

IME, there is no obvious problem with the dependencies (as they relate
to ufw) since cloud-init is allowed to start/finish before sysinit and
network-pre just like before. It is just that now network-pre is
guaranteed to be after sysinit (which from cloud-init's point of view,
shouldn't necessarily be a concern). It is also guaranteed to be after
ufw but, unless cloud-init is doing something with ufw such as perhaps
enabling ufw and restarting the ufw service, cloud-init shouldn't care
cause the ufw service doesn't do anything unless ufw is enabled (and
even when it is enabled, it just loads firewall rules).

This makes me want to understand the cloud-init configuration that is in
play. Can you share it?

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1950039

Title:
  ufw 0.36.1-3 introduces ordering cycle, breaking network

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/1950039/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to