From eedc3027d636fc57e3c3ba2dc2bd58c50e3002be Mon Sep 17 00:00:00 2001 From: Aliaksandr Date: Tue, 23 Jun 2026 22:19:06 +0300 Subject: [PATCH 1/3] nixos/glusterfs: fix dangling glusterfind hook symlink The hooks tree copied into /var/lib/glusterd contains one symlink, S57glusterfind-delete-post, whose relative target resolves inside the package's $out but dangles once copied verbatim into / (the referent lives in the Nix store, not under /libexec). Pass --copy-unsafe-links so rsync dereferences symlinks pointing outside the tree into real files. Fixes #257863. Assisted-by: claude-code with claude-opus-4-8[1m]-high --- nixos/modules/services/network-filesystems/glusterfs.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/network-filesystems/glusterfs.nix b/nixos/modules/services/network-filesystems/glusterfs.nix index db00cdc11abb..ad909321d293 100644 --- a/nixos/modules/services/network-filesystems/glusterfs.nix +++ b/nixos/modules/services/network-filesystems/glusterfs.nix @@ -180,7 +180,9 @@ in # Excludes one hook due to missing SELinux binaries. + '' mkdir -p /var/lib/glusterd/hooks/ - ${rsync}/bin/rsync -a --exclude="S10selinux-label-brick.sh" ${glusterfs}/var/lib/glusterd/hooks/ /var/lib/glusterd/hooks/ + # --copy-unsafe-links: the glusterfind hook is a symlink into the package's + # libexec that would dangle once copied verbatim into / (#257863). + ${rsync}/bin/rsync -a --copy-unsafe-links --exclude="S10selinux-label-brick.sh" ${glusterfs}/var/lib/glusterd/hooks/ /var/lib/glusterd/hooks/ ${tlsCmd} '' From 70c0f1059c44f4ddfdded8764adcf462785e75f7 Mon Sep 17 00:00:00 2001 From: Aliaksandr Date: Tue, 23 Jun 2026 22:19:22 +0300 Subject: [PATCH 2/3] nixos/glusterfs: install group presets into /var/lib/glusterd Upstream installs the volume option presets into $(localstatedir)/lib/glusterd/groups, which ends up under the package's $out/var rather than /var, so `gluster volume set group ` failed for metadata-cache, nl-cache, virt, etc. Copy them into place alongside the existing hooks rehydration. Fixes #33159. Assisted-by: claude-code with claude-opus-4-8[1m]-high --- nixos/modules/services/network-filesystems/glusterfs.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nixos/modules/services/network-filesystems/glusterfs.nix b/nixos/modules/services/network-filesystems/glusterfs.nix index ad909321d293..c218d5505566 100644 --- a/nixos/modules/services/network-filesystems/glusterfs.nix +++ b/nixos/modules/services/network-filesystems/glusterfs.nix @@ -191,6 +191,12 @@ in + '' mkdir -p /var/lib/glusterd/glusterfind/.keys mkdir -p /var/lib/glusterd/hooks/1/delete/post/ + '' + # Volume option presets, installed by upstream under $out/var; copy them so + # `gluster volume set group ` works (#33159). + + '' + mkdir -p /var/lib/glusterd/groups/ + ${rsync}/bin/rsync -a ${glusterfs}/var/lib/glusterd/groups/ /var/lib/glusterd/groups/ ''; serviceConfig = { From 66cd3515f71744b9ec614c1328eb898da547ed79 Mon Sep 17 00:00:00 2001 From: Aliaksandr Date: Thu, 25 Jun 2026 14:42:03 +0300 Subject: [PATCH 3/3] nixos/tests/glusterfs: cover group presets and glusterfind hook Assert that the glusterfind delete hook is a real file rather than a dangling symlink (#257863), that the volume option presets are installed (#33159), and that a `group` preset can actually be applied to a volume. Assisted-by: claude-code with claude-opus-4-8[1m]-high --- nixos/tests/glusterfs.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/nixos/tests/glusterfs.nix b/nixos/tests/glusterfs.nix index 9224797704e2..ac4c8e7024f7 100644 --- a/nixos/tests/glusterfs.nix +++ b/nixos/tests/glusterfs.nix @@ -49,6 +49,14 @@ in server1.wait_for_unit("glusterd.service") server2.wait_for_unit("glusterd.service") + # The glusterfind delete hook must be a real file, not the dangling + # symlink it used to be after being copied out of the package (#257863). + server1.succeed("test -f /var/lib/glusterd/hooks/1/delete/post/S57glusterfind-delete-post") + server1.fail("test -L /var/lib/glusterd/hooks/1/delete/post/S57glusterfind-delete-post") + + # The volume option presets must be installed (#33159). + server1.succeed("test -f /var/lib/glusterd/groups/metadata-cache") + server1.wait_until_succeeds("gluster peer status") server2.wait_until_succeeds("gluster peer status") @@ -64,6 +72,9 @@ in server1.succeed("gluster volume create gv0 server1:/data/vg0 server2:/data/vg0") server1.succeed("gluster volume start gv0") + # Applying a group preset needs /var/lib/glusterd/groups populated (#33159). + server1.succeed("gluster volume set gv0 group metadata-cache") + # test clients client1.wait_for_unit("gluster.mount") client2.wait_for_unit("gluster.mount")