From 6491b69c0e72748b43e9698c485ab1f530df6ba9 Mon Sep 17 00:00:00 2001 From: Yaroslav Rogov Date: Mon, 31 May 2021 16:32:01 +0300 Subject: [PATCH] fix: Force Erlang cookie perms Co-authored-by: Andrey Fadeev --- prestart.d/00-set-cookie-permissions.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 prestart.d/00-set-cookie-permissions.sh diff --git a/prestart.d/00-set-cookie-permissions.sh b/prestart.d/00-set-cookie-permissions.sh new file mode 100644 index 0000000..da14f22 --- /dev/null +++ b/prestart.d/00-set-cookie-permissions.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# Riak is sensitive to permissions on the erlang distribution cookie file. +# The ERTS requires that the cookie permissions are always 0600. +# In some environments, file permissions may change. For example, this +# can happen in kubernetes if the `fsGroup` option is used. + +COOKIE_PATH="/var/lib/riak/.erlang.cookie" + +if [ -e "$COOKIE_PATH" ]; then + chmod 0600 "$COOKIE_PATH" +fi