Skip to content

stratisd.service: Remove DefaultDependencies=no and After=multi-user.target#4019

Open
kriansa wants to merge 1 commit into
stratis-storage:masterfrom
kriansa:fix/stratisd-service-ordering-cycle
Open

stratisd.service: Remove DefaultDependencies=no and After=multi-user.target#4019
kriansa wants to merge 1 commit into
stratis-storage:masterfrom
kriansa:fix/stratisd-service-ordering-cycle

Conversation

@kriansa

@kriansa kriansa commented May 9, 2026

Copy link
Copy Markdown

Summary

Removes DefaultDependencies=no and After=multi-user.target from stratisd.service.in.

These two directives created an ordering cycle for any multi-user.target service that depends on stratisd.service:

dependent.service → (After) stratisd.service → (After) multi-user.target → (Wants) dependent.service

With default dependencies restored, systemd adds After=basic.target automatically, which is sufficient since stratisd is a Type=dbus service and D-Bus is available after basic.target.

Why this is safe

The Clevis/fstab boot path introduced in #3826 is handled entirely by stratisd-min-postinitrd and the stratis-fstab-setup units — they are independent of stratisd.service. Change 3 in #3826 (moving from After=local-fs.target to After=multi-user.target) was not needed for the Clevis fix; changes 1 and 2 of that PR (the new stratis-fstab-setup-with-network@.service and removing Before=local-fs-pre.target from stratisd-min-postinitrd.service) are what fixed Clevis/Tang support.

A QEMU-based reproduction at https://github.com/kriansa/stratisd-boot-cycle-repro verifies:

  1. The ordering cycle exists with the current unit file
  2. Removing the two lines resolves the cycle
  3. A simulated Clevis/network fstab service (matching stratis-fstab-setup-with-network@ ordering) completes successfully after the fix

Test plan

  • Boot with stratisd.service enabled and a downstream service with After=stratisd.service in multi-user.target — confirm no ordering cycle
  • Confirm stratisd starts correctly (D-Bus available via basic.target)
  • Test Clevis/Tang fstab path is unaffected

Closes #3968

@packit-as-a-service

Copy link
Copy Markdown

Congratulations! One of the builds has completed. 🍾

You can install the built RPMs by following these steps:

  • sudo dnf install -y 'dnf*-command(copr)'
  • dnf copr enable packit/stratis-storage-stratisd-4019-copr_pull
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.

@mulkieran mulkieran moved this to In Review in 2026May May 11, 2026
@mulkieran mulkieran added this to the v3.9.1 milestone May 11, 2026
@kriansa

kriansa commented May 11, 2026

Copy link
Copy Markdown
Author

@mulkieran I'm unable to confirm whether the failing test is actually an issue or a transient CI failure. Could you retrigger it just in case?

@mulkieran

Copy link
Copy Markdown
Member

@mulkieran I'm unable to confirm whether the failing test is actually an issue or a transient CI failure. Could you retrigger it just in case?

@kriansa Ignore that rawhide test failure, it's due to the rawhide environment, specifically a util-linux change which will be fixed with the next release of util-linux.

Would you mind rebasing and doing a force-push to bring your PR up-to-date? Thanks!

@mulkieran mulkieran requested a review from jbaublitz May 12, 2026 13:24
DefaultDependencies=no and After=multi-user.target created a boot
ordering cycle for any service in multi-user.target that depends on
stratisd. Removing these two directives restores default dependencies,
which include After=basic.target — sufficient for D-Bus availability.

The Clevis/fstab boot path is handled entirely by
stratisd-min-postinitrd and stratis-fstab-setup units, which are
independent of stratisd.service, so this change does not affect that
path.

Fixes: stratis-storage#3968
@kriansa kriansa force-pushed the fix/stratisd-service-ordering-cycle branch from 07dbfb2 to 403eb7b Compare May 12, 2026 13:30
@kriansa

kriansa commented May 12, 2026

Copy link
Copy Markdown
Author

@mulkieran sure! I did it using the GH interface. Is that OK?

@mulkieran

Copy link
Copy Markdown
Member

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 13, 2026

Copy link
Copy Markdown
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented May 13, 2026

Copy link
Copy Markdown

Walkthrough

This PR removes two systemd unit configuration directives from stratisd.service.in: DefaultDependencies=no and After=multi-user.target. The change allows the service to use standard default dependencies, resolving a dependency ordering cycle that prevented other multi-user.target services from depending on stratisd.

Changes

Systemd Unit Configuration

Layer / File(s) Summary
Remove systemd ordering constraints
systemd/stratisd.service.in
The [Unit] section no longer declares DefaultDependencies=no and After=multi-user.target, allowing the service to rely on systemd's standard default dependencies, which provide sufficient ordering for D-Bus availability.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested reviewers

  • mulkieran
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The PR title accurately and concisely describes the main change: removing two specific directives from the stratisd.service.in file.
Linked Issues check ✅ Passed The code changes directly address the objectives in #3968 by removing DefaultDependencies=no and After=multi-user.target to resolve the ordering cycle issue.
Out of Scope Changes check ✅ Passed The changes are narrowly scoped to the stated objective: only the two problematic directives are removed from stratisd.service.in with no other alterations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mulkieran mulkieran removed this from 2026May Jun 1, 2026
@mulkieran mulkieran moved this to In Review in 2026June Jun 1, 2026
@mulkieran mulkieran modified the milestones: v3.9.1, v3.9.2 Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

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

2 participants