I have a templated systemd service that depends on cloud-init to be done on Amazon Linux 2023.
[Unit]
Description=My service
After=cloud-init.target
[Service]
Type=exec
EnvironmentFile=/local/service/my.env
ExecStart=/local/service/myservice
Restart=always
User=myuser
[Install]
WantedBy=multi-user.target
A service instance has been enabled via sudo systemctl enable [email protected]
.
Getting this:
multi-user.target: Found ordering cycle on [email protected]/start
multi-user.target: Found dependency on cloud-init.target/start
multi-user.target: Found dependency on multi-user.target/start
multi-user.target: Job myservice.service@1/start deleted to break ordering cycle starting with multi-user.target/start
This worked on a very recent version of Amazon Linux 2023 and seems to not work now. I'm walking through everything to track it down, but if anyone has insight, that would be awesome.
UPDATE: I changed the WantedBy=
to cloud-init.target
. This seems to have fixed the problem. I don't have time currently to track down the differences in dependencies between the previous AL2023 AMI and the current, but this should be good for the time being.