From 2797ddb1f3c2ae1d40267eb454907a2242f5e6c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= Date: Thu, 18 Jun 2026 10:24:59 +0000 Subject: [PATCH] nixos/ceph: Create /var/log/ceph to enable logging --- nixos/modules/services/network-filesystems/ceph.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nixos/modules/services/network-filesystems/ceph.nix b/nixos/modules/services/network-filesystems/ceph.nix index c5d7e365fe67..328b33ee7d70 100644 --- a/nixos/modules/services/network-filesystems/ceph.nix +++ b/nixos/modules/services/network-filesystems/ceph.nix @@ -481,6 +481,15 @@ in "/run/ceph".d = defaultConfig // { mode = "0770"; }; + # Ceph daemons log to files under `/var/log/ceph` by default + # (`log_to_file = true`, `log_file = /var/log/ceph/$cluster-$name.log`). + # The daemons run as the unprivileged `ceph` user under + # `ProtectSystem=full` and cannot create this directory themselves, and + # Ceph silently discards its logs if the directory is missing; it does + # not even warn; the `::open()` failure in `Log::reopen_log_file()` is + # ignored, see https://github.com/ceph/ceph/blob/v20.2.1/src/log/Log.cc#L165-L174. + # Create the directory so logging works out of the box. + "/var/log/ceph".d = defaultConfig; "/var/lib/ceph".d = defaultConfig; "/var/lib/ceph/mgr".d = lib.mkIf (cfg.mgr.enable) defaultConfig; "/var/lib/ceph/mon".d = lib.mkIf (cfg.mon.enable) defaultConfig;