ceph: compile with systemd support flag#440226
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR enables systemd support in the Ceph package by turning on the WITH_SYSTEMD=ON flag, which generates systemd unit files and improves journald logging. The change includes a backported fix to ensure unit files are properly prefixed with the Nix store path instead of hardcoded system paths.
- Enable systemd support compilation flag with conditional withSystemd parameter
- Backport upstream fix for systemd unit file prefix installation
- Add systemd dependency and configuration for proper unit file generation
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkgs/tools/filesystems/ceph/default.nix | Add systemd dependency, withSystemd parameter, and enable systemd compilation with proper configuration |
| pkgs/tools/filesystems/ceph/ceph-systemd-prefix.patch | Backported patch fixing systemd unit file paths to use CMAKE_INSTALL_PREFIX instead of hardcoded /usr paths |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
As the commit is merged upstream already, I think using fetchpatch2 would be more appropriate to avoid the unsustainable growth of the nixpkgs repo. I may have a look at this soon-ish, given that my cluster setup takes pains to side-step some of the systemd logic (for reasons), that way I could confirm whether or not this impacts anything other than the NixOS modules. |
Yeah, unfortunately I did have to make a small tweak to get it to apply cleanly.
Ah yes, I feel like I can guess what some of those reasons might be 😁. I'm hoping to help smooth some of those other ceph tooling systemd expectations in the future. Thanks! |
|
I just had a short glance over the patch and noticed something odd so I compared it with upstream. diff --git a/upstream b/pr
index c4d1e4f..9ceedac 100644
--- a/upstream
+++ b/pr
@@ -191,9 +169,9 @@ index 6644508cf0dea..0933676d2aca0 100644
-ExecStart=/usr/bin/rbdmap map
-ExecReload=/usr/bin/rbdmap map
-ExecStop=/usr/bin/rbdmap unmap-all
-+ExecStart=@CMAKE_INSTALL_PREFIX@/bin/rbdmap map
-+ExecReload=@CMAKE_INSTALL_PREFIX@/bin/rbdmap map
-+ExecStop=@CMAKE_INSTALL_PREFIX@/bin/rbdmap unmap-all
++ExecStart=@CMAKE_INSTALL_PREFIX@/rbdmap map
++ExecReload=@CMAKE_INSTALL_PREFIX@/rbdmap map
++ExecStop=@CMAKE_INSTALL_PREFIX@/rbdmap unmap-all
[Install]
WantedBy=multi-user.targetYou mentioned you had to adjust something, but I'm confused as to why there's this discrepancy given that there is a bin directory on our end too: % find /nix/store/3c9migshmrcypwsvkql98n7l72ignhw1-ceph-19.2.2 -name rbdmap
/nix/store/3c9migshmrcypwsvkql98n7l72ignhw1-ceph-19.2.2/bin/rbdmapI believe you that it's required (again, just had a glance at it, haven't even built it), it just looks strange to me and as if there's another issue hiding in our packaging perhaps (though it could be intentional as well, I'll have to have a look). |
Good catch! I'm going to switch this over to Fixed in 0bb5395447bbff472f8a7689d134c8d21da3e04e I also did find one more bug in |
9a6f699 to
610063e
Compare
|
|
I'm clicking "Merge when ready". Ofborg on Linux is already green. |
|
Thanks @nh2 @benaryorg! I'll be curious to hear from anyone who ends up testing these new units directly what they think. |
This patch turns on
WITH_SYSTEMD=ONso that systemd units are generated under$out/lib/systemd/system. These upstream units would be compatible withsystemd.packagesinclusion, potentially usable by NixOS modules in the future (a larger integration not proposed here), or useful on non‑NixOS systems via tools like system-manager. TheWITH_SYSTEMD=ONflag also enables some improved journald logging support as well.Unfortunately, the unit definitions in the Ceph 19.2.3 release are not correctly prefixed at install time. However, this has already been fixed upstream to install using
@CMAKE_INSTALL_PREFIX@. This patch backports that fix, allowing the patch to be safely dropped in the future when Ceph releases with the upstream change included.Tested with/without
withSystemdand ran ceph NixOS module related tests.Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Add a 👍 reaction to pull requests you find important.