From f3b9ac73e2beb9729ce9aad4dd0e25c56d57d056 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Sat, 23 Sep 2017 17:54:49 -0400 Subject: [PATCH] nixos/rabbitmq: fix restarts and sasl logs 1. The chmod 400 with the preset cookie prevented restarts, as on the second boot it would fail to write to the cookie. Oops. 2. As far as I can tell, sasl logs were disabled because of the following error: {error,{cannot_log_to_tty,sasl_report_tty_h,not_installed}} Not because we actually wanted to disable them. This meant the management plugin wasn't usable due to a bug set to be fixed in 3.7.0. --- nixos/modules/services/amqp/rabbitmq.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/amqp/rabbitmq.nix b/nixos/modules/services/amqp/rabbitmq.nix index 61545a5acba8..f536d56d7c63 100644 --- a/nixos/modules/services/amqp/rabbitmq.nix +++ b/nixos/modules/services/amqp/rabbitmq.nix @@ -105,7 +105,8 @@ in { RABBITMQ_MNESIA_BASE = "${cfg.dataDir}/mnesia"; RABBITMQ_NODE_IP_ADDRESS = cfg.listenAddress; RABBITMQ_NODE_PORT = toString cfg.port; - RABBITMQ_SERVER_START_ARGS = "-rabbit error_logger tty -rabbit sasl_error_logger false"; + RABBITMQ_LOGS = "-"; + RABBITMQ_SASL_LOGS = "-"; RABBITMQ_PID_FILE = "${cfg.dataDir}/pid"; SYS_PREFIX = ""; RABBITMQ_ENABLED_PLUGINS_FILE = pkgs.writeText "enabled_plugins" '' @@ -128,7 +129,7 @@ in { preStart = '' ${optionalString (cfg.cookie != "") '' echo -n ${cfg.cookie} > ${cfg.dataDir}/.erlang.cookie - chmod 400 ${cfg.dataDir}/.erlang.cookie + chmod 600 ${cfg.dataDir}/.erlang.cookie ''} ''; };