← Back to team overview

cloud-init team mailing list archive

Still struggling with systemd cycle

 

Hi,

OK, I am still struggling to get 0.7.8 + some patches to work properly.
The reason is a unit file cycle.

multi-user.target: Found ordering cycle on multi-user.target/start
 systemd[1]: multi-user.target: Found dependency on cloud-init.target/start
 systemd[1]: multi-user.target: Found dependency on
cloud-final.service/start
 systemd[1]: multi-user.target: Found dependency on multi-user.target/start
 systemd[1]: multi-user.target: Breaking ordering cycle by deleting job
cloud-init.target/start
 Ordering cycle found, skipping Cloud-init target
 Ordering cycle found, skipping Login Service
 Ordering cycle found, skipping wicked DHCPv4 supplicant service
 Ordering cycle found, skipping Init...t job (metadata service crawler)

wicked on SUSE brings up the network and configures it. But I have now
come to the conclusion that this should not be a SUSE only problem.

I have had a look at xenial, launched from ami-2ef48339. Unfortunatly
the systemd version there lacks --list-dependencies and thus graphically
showing the dependencies is not possible, but I'll try and explain.

All the cloud-init*.services use

[Install]
WantedBy=cloud-init.target

This implies that cloud-final.service needs to run before
cloud-init.target is completed.

However, in the latest version in master we have for cloud-final.service

After=multi-user.target

But in cloud-init.service we for example have

Before=network-online.target

and cloud-init.service is also part of the cloud-init.target as is
cloud-final.service. Thus the cloud-init.target has a requirement to run
before multi-user.target is reached (network-online.target is part of
multi-user.target) while also having a requirement to run after
multi-user.target is reached.

It appears to me that the systemd complaint is correct.

Given that rc-local.service is a direct dependency for
multi-user.target, as shown in the diagram below (hoping that mail
servers and clients will not make too big of a mess with it) and we
already have

After=rc-local.service

and rc-local.service is probably one of the last things to run before
multi-user.target is reached it is probably save to drop

After=multi-user.target

from cloud-final.service.

Thoughts?

Thanks,
Robert

multi-user.target
● ├─after-local.service
● ├─auditd.service
● ├─cron.service
● ├─dbus.service
● ├─irqbalance.service
● ├─nscd.service
● ├─purge-kernels.service
● ├─rc-local.service
● ├─sshd.service
● ├─systemd-logind.service
● ├─systemd-update-utmp-runlevel.service
● ├─systemd-user-sessions.service
● ├─wicked.service
● ├─basic.target
● │ ├─paths.target
● │ ├─slices.target
● │ │ ├─-.slice
● │ │ └─system.slice
● │ ├─sockets.target
● │ │ ├─dbus.socket
● │ │ ├─iscsid.socket
● │ │ ├─systemd-initctl.socket
● │ │ ├─systemd-journald.socket
● │ │ ├─systemd-shutdownd.socket
● │ │ ├─systemd-udevd-control.socket
● │ │ └─systemd-udevd-kernel.socket
● │ ├─sysinit.target
● │ │ ├─apparmor.service
● │ │ ├─dev-hugepages.mount
● │ │ ├─dev-mqueue.mount
● │ │ ├─haveged.service
● │ │ ├─kmod-static-nodes.service
● │ │ ├─lvm2-lvmetad.socket
● │ │ ├─proc-sys-fs-binfmt_misc.automount
● │ │ ├─sys-fs-fuse-connections.mount
● │ │ ├─sys-kernel-config.mount
● │ │ ├─sys-kernel-debug.mount
● │ │ ├─systemd-ask-password-console.path
● │ │ ├─systemd-binfmt.service
● │ │ ├─systemd-firstboot.service
● │ │ ├─systemd-journal-flush.service
● │ │ ├─systemd-journald.service
● │ │ ├─systemd-modules-load.service
● │ │ ├─systemd-random-seed.service
● │ │ ├─systemd-sysctl.service
● │ │ ├─systemd-tmpfiles-setup-dev.service
● │ │ ├─systemd-tmpfiles-setup.service
● │ │ ├─systemd-udev-root-symlink.service
● │ │ ├─systemd-udev-trigger.service
● │ │ ├─systemd-udevd.service
● │ │ ├─systemd-update-utmp.service
● │ │ ├─systemd-vconsole-setup.service
● │ │ ├─cryptsetup.target
● │ │ ├─local-fs.target
● │ │ │ ├─-.mount
● │ │ │ ├─systemd-fsck-root.service
● │ │ │ ├─systemd-remount-fs.service
● │ │ │ ├─var-lock.mount
● │ │ │ └─var-run.mount
● │ │ └─swap.target
● │ └─timers.target
● │   └─systemd-tmpfiles-clean.timer
● ├─cloud-init.target
● │ ├─cloud-config.service
● │ ├─cloud-final.service
● │ ├─cloud-init-local.service
● │ └─cloud-init.service
● ├─getty.target
● │ ├─getty@tty1.service
● │ └─serial-getty@ttyS0.service
● └─remote-fs.target
●   ├─iscsi.service
●   └─remote-fs-pre.target



-- 
Robert Schweikert                   MAY THE SOURCE BE WITH YOU
Public Cloud Architect                         LINUX
rjschwei@xxxxxxxx
IRC: robjo

Attachment: signature.asc
Description: OpenPGP digital signature


Follow ups