Bug#1112013: cloud-init-network.service conflicts with dkms.service, and fails to start when both are installed
Control: tags -1 + moreinfo
On Mon, Aug 25, 2025 at 07:38:51AM +0000, Jeff Wong wrote:
> I was attempting to update from Debian 11.6 to Debian 13.0 and noticed cloud-init config to be non-functional.
> * hostname was not changed
> * resolv.conf blank
> * sshd keys not generating
>
> I am installing both Debian 11.6 and 13.0 through Packer, and deployed through Terraform to a Proxmox server.
> Both cloud-init and dkms were being installed via a preseed file.
>
> Additionally, systemd reported a circular dependency on boot:
>
> Job cloud-init-network.service/start deleted to break ordering cycle starting with sysinit.target/start
> journalctl -b | egrep "Found":
> Aug 25 01:29:21 test systemd[1]: networking.service: Found ordering cycle on network-pre.target/start
> Aug 25 01:29:21 test systemd[1]: networking.service: Found dependency on dkms.service/start
> Aug 25 01:29:21 test systemd[1]: networking.service: Found dependency on basic.target/start
> Aug 25 01:29:21 test systemd[1]: networking.service: Found dependency on sysinit.target/start
> Aug 25 01:29:21 test systemd[1]: networking.service: Found dependency on cloud-init-network.service/start
> Aug 25 01:29:21 test systemd[1]: networking.service: Found dependency on networking.service/start
>
> What worked was directly editing and deleting the line in
> /usr/lib/systemd/system/cloud-init-network.service:
>
> BEFORE=sysinit.target
>
> cloud-init-network.service was able to go and all three symptoms were resolved.
>
> On closer inspection with circular dependencies, I noticed dkms being installed in my preseed file.
> dkms was also present in all instances of circular dependency logs.
>
> Removing dkms from the preseed packages resolves the issue.
> I do not need the package installed, but I am reporting regardless.
Interesting. I don't seem to have this problem. See below for output.
Can you send the output of the following:
$ systemctl list-dependencies --reverse cloud-init-network.service dkms.service sysinit.target
Are you passing any additional cloud-init configuration via user_data or
other mechanism?
root@bug1112013:~# systemctl --no-pager -l status cloud-init-network.service dkms.service
● cloud-init-network.service - Cloud-init: Network Stage
Loaded: loaded (/usr/lib/systemd/system/cloud-init-network.service; enabled; preset: enabled)
Active: active (exited) since Mon 2025-08-25 21:39:44 UTC; 3min 44s ago
Invocation: a32ca725d0f54752b23355a1917f2453
Process: 602 ExecStart=sh -c echo "start" | nc -Uu -W1 /run/cloud-init/share/network.sock -s /run/cloud-init/share/network-return.sock | sh (code=exited, status=0/SUCCESS)
Main PID: 602 (code=exited, status=0/SUCCESS)
Mem peak: 1.7M
CPU: 10ms
Aug 25 21:39:43 bug1112013 systemd[1]: Starting cloud-init-network.service - Cloud-init: Network Stage...
Aug 25 21:39:44 bug1112013 sh[605]: Completed socket interaction for boot stage network
Aug 25 21:39:44 bug1112013 systemd[1]: Finished cloud-init-network.service - Cloud-init: Network Stage.
● dkms.service - Builds and install new kernel modules through DKMS
Loaded: loaded (/usr/lib/systemd/system/dkms.service; enabled; preset: enabled)
Active: active (exited) since Mon 2025-08-25 21:39:44 UTC; 3min 44s ago
Invocation: 524240da666c430cab316862eb09b031
Docs: man:dkms(8)
Process: 647 ExecStart=/usr/sbin/dkms autoinstall --verbose --kernelver 6.12.41+deb13-amd64 (code=exited, status=0/SUCCESS)
Main PID: 647 (code=exited, status=0/SUCCESS)
Mem peak: 5M
CPU: 90ms
Aug 25 21:39:44 bug1112013 systemd[1]: Starting dkms.service - Builds and install new kernel modules through DKMS...
Aug 25 21:39:44 bug1112013 systemd[1]: Finished dkms.service - Builds and install new kernel modules through DKMS.
root@bug1112013:~# systemctl is-system-running
running
Reply to: