Hello,

this is not caused by Netplan itself (but one of the things the update
does will lead to the error). Below is a Dockerfile you can use to
reproduce the problem. As you can see, netplan.io is not involved in it.

----

FROM ubuntu:22.04

RUN apt-get update && apt-get install --yes --no-install-recommends \
    systemd \
    openssh-server ; mkdir /run/systemd/system

RUN systemctl enable ssh

----

Here is why it fails:

The call to "systemctl enable ssh" gets redirected to
"/lib/systemd/systemd-sysv-install enable ssh" which works, because the
file "/etc/init.d/ssh" exists.

"systemd-sysv-install" is a script that will call another script called
"/usr/sbin/update-rc.d". This second script will check if
/run/systemd/system exists and assume systemd is available if it does.

Why it started to happen after the security update? One of the issues we
fixed was a bad file permission we were using. To ensure that the
permissions are set to the correct ones, the update calls the netplan
generator to recreate the files. One of the things the generator does is
create that directory.

To workaround this you can just remove that directory before calling
systemctl:

----

FROM ubuntu:22.04

RUN apt-get update && apt-get install --yes --no-install-recommends \
    systemd \
    openssh-server \
    netplan.io ; rm -rf /run/systemd/system

RUN systemctl enable ssh

----

** Changed in: netplan.io (Ubuntu)
       Status: New => Triaged

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

Title:
  netplan.io causes systemctl enable to fail on systems without dbus

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/netplan.io/+bug/2071333/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to