From 3464c602e83687954b711bb9b30c5d85303f6f51 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sat, 6 Jul 2019 20:42:56 +0200 Subject: [PATCH] nixos/graylog: fix startup Until now the startup failed with an error like this: ``` com.github.joschi.jadconfig.ValidationException: Parent path /var/lib/graylog/server for Node ID file at /var/lib/graylog/server/node-id is not a directory ``` This happens since `graylog.service` ensures that `/var/lib/graylog` exists, however it doesn't take care of the directory for `cfg.nodeIdFile`. --- nixos/modules/services/logging/graylog.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nixos/modules/services/logging/graylog.nix b/nixos/modules/services/logging/graylog.nix index ee566825498..49f3187fd31 100644 --- a/nixos/modules/services/logging/graylog.nix +++ b/nixos/modules/services/logging/graylog.nix @@ -150,6 +150,9 @@ in rm -rf /var/lib/graylog/plugins || true mkdir -p /var/lib/graylog/plugins -m 755 + mkdir -p "$(dirname ${cfg.nodeIdFile})" + chown -R ${cfg.user} "$(dirname ${cfg.nodeIdFile})" + for declarativeplugin in `ls ${glPlugins}/bin/`; do ln -sf ${glPlugins}/bin/$declarativeplugin /var/lib/graylog/plugins/$declarativeplugin done