Skip to content

stratisd.service: After=multi-user.target creates ordering cycle for dependent services #3968

@kriansa

Description

@kriansa

Hello all! First of all, thanks for the great work on Stratis. I just recently started using it, and it's amazing.

I have a Podman volume plugin backed by Stratis. It works well for containers created after the host has initialized, but for containers using Quadlet (which are essentially systemd units), I have a dependency ordering issue that prevents units with stratis volumes from initializing at boot.

I took some time to analyze the current unit file and test a potential fix for any service that depends on stratisd.service.

Context

For context, stratisd.service currently uses:

DefaultDependencies=no
After=multi-user.target
...
[Install]
WantedBy=multi-user.target

This creates an ordering cycle for any service in multi-user.target that depends on stratisd. For example, my volume plugin service has:

After=stratisd.service
Wants=stratisd.service

[Install]
WantedBy=multi-user.target

Produces the cycle:

podman-volume-stratis.service -> (After) -> stratisd.service -> (After) -> multi-user.target -> podman-volume-stratis.service

The After=multi-user.target was introduced in #3826 (changing from After=local-fs.target) as part of reworking fstab/Clevis dependencies. Since early boot device assembly is now handled by stratisd-min-postinitrd, the full stratisd daemon doesn't need special boot ordering — it just needs D-Bus, which is available after basic.target.

Proposed fix

I would remove DefaultDependencies=no and After=multi-user.target from stratisd.service.in. The standard default dependencies already provide After=sysinit.target basic.target, which ensures D-Bus availability for the Type=dbus service. This allows downstream services to use After=stratisd.service without creating cycles. I've tested this locally, and it's working -- at least for my use cases.

I'm willing to submit a PR if you agree with the fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions