Skip to content

Commit

Permalink
Merge pull request #1172 from flyingcircusio/phil/FC-41917_fix-rabbit…
Browse files Browse the repository at this point in the history
…mq-cookie-logic

[PL-133192] fix rabbitmq cookie permission errors
  • Loading branch information
osnyx authored Nov 27, 2024
2 parents cf2a530 + 35f5c0d commit ce4e528
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!--
A new changelog entry.
Delete placeholder items that do not apply. Empty sections will be removed
automatically during release.
Leave the XX.XX as is: this is a placeholder and will be automatically filled
correctly during the release and helps when backporting over multiple platform
branches.
-->

### Impact


### NixOS XX.XX platform

- Fix permissions for some platform logic that creates a `.erlang.cookie` for rabbitmq which would previously cause a failure when starting the service.
The problem was caused due to insufficient write permissions when attempting to write the cookie after rabbitmq's first startup.
During first startup, rabbimq generates a random cookie, writes it to the appropriate file and sets that file to be read-only.
3 changes: 1 addition & 2 deletions nixos/services/rabbitmq/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,7 @@ in {

preStart = ''
${optionalString (cfg.cookie != "") ''
echo -n ${cfg.cookie} > ${cfg.dataDir}/.erlang.cookie
chmod 600 ${cfg.dataDir}/.erlang.cookie
install -m 400 <(echo -n ${cfg.cookie}) ${cfg.dataDir}/.erlang.cookie
''}
'';
};
Expand Down

0 comments on commit ce4e528

Please sign in to comment.