Make sure setting cookie really works on a read-only fs

This commit is contained in:
Wojtek Mach 2023-01-17 10:42:00 +01:00
parent c751e444e7
commit 511df69495

View file

@ -9,8 +9,7 @@ export PATH="$RELEASE_ROOT/vendor/otp/erts-<%= @release.erts_version%>/bin:$RELE
cookie_path="${RELEASE_ROOT}/releases/COOKIE"
if [ ! -f $cookie_path ]; then
RELEASE_COOKIE=$(cat /dev/urandom | env LC_ALL=C tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
echo "$RELEASE_COOKIE" > "$cookie_path"
[ $? -eq 0 ] || export RELEASE_COOKIE
echo "$RELEASE_COOKIE" > "$cookie_path" || export RELEASE_COOKIE
fi
cd $HOME