Skip to content

Systemd boot order #5755

@benj-n

Description

@benj-n

Bug report

Hi,

While I was building an ArchLinux package based on cloud-init 24.3.1, I found that cloud-init-main.service was never started at boot. Trying to understand what was happening I found this in the service template:

https://github.com/canonical/cloud-init/blob/24.3.1/systemd/cloud-init-main.service.tmpl#L22-L30

First, there a double definition of:

Before=sysinit.target
Conflicts=shutdown.target 

These lines appear in a if statement and outside.

Second, on some OS (I was working on Arch, but it may not be limited to it), the Before=sysinit.target conflicts with Wants=network-pre.target a few lines above (Sysinit.target happens before network-pre.target).

The more I look at it, the more I think the Before=sysinit.targetand Conflicts=shutdown.targetoutside the if statement were not meant to be merged. It could be nice to have @holmanb thoughts on this.

Environment details

  • Cloud-init version: >=24.3.
  • Operating System Distribution: Discovered on ArchLinux but shouldn't be relevant
  • Cloud provider, platform or installer type: Discovered on Cloudstack but shouldn't be relevant

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working correctlynewAn issue that still needs triage

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions