From 342cd2abc6cfc3b42ece608b327398fd46bad99e Mon Sep 17 00:00:00 2001 From: Lzebulon Date: Sat, 31 Jan 2026 13:51:25 +0100 Subject: [PATCH] auto start osd code from https://wiki.nixos.org/wiki/Ceph --- hosts/physiques/cephiroth/ceph.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/hosts/physiques/cephiroth/ceph.nix b/hosts/physiques/cephiroth/ceph.nix index 11792ec..0cbf089 100644 --- a/hosts/physiques/cephiroth/ceph.nix +++ b/hosts/physiques/cephiroth/ceph.nix @@ -55,5 +55,23 @@ }; }; + # automaticaly start osd when we restart the server + systemd.services.ceph-mesh = { + enable = true; + description = "Ceph OSD Bindings"; + unitConfig = { + After = "local-fs.target"; + Wants = "local-fs.target"; + }; + serviceConfig = { + Type = "oneshot"; + KillMode = "none"; + Environment = "CEPH_VOLUME_TIMEOUT=10000 PATH=$PATH:/run/current-system/sw/bin/"; + ExecStart = "/bin/sh -c 'timeout $CEPH_VOLUME_TIMEOUT /run/current-system/sw/bin/ceph-volume lvm activate --all --no-systemd'"; + TimeoutSec = 0; + }; + wantedBy = ["multi-user.target"]; + }; + environment.systemPackages = [ pkgs.ceph pkgs.smartmontools ]; }