Open artman41 opened 2 years ago
Thanks, yea, I guess we need to utilize the files
array to check all of them for everything (not just COOKIE, but dist args too).
@tsloughter just wrote this function which I'm going to put copy into our extended_bin
after relx creates it, I'm thinking it can replace the call on line 728, any use?
function get_cookie() {
local vm_args_file="$1";
if [[ -z "$vm_args_file" ]]; then
echo 'vm_args_file was empty!' >&2;
exit 1;
fi;
local cookie="$(grep '^-setcookie' $vm_args_file)";
for args_file in $(grep '^-args_file' $vm_args_file | awk '{print $2}'); do
local new_cookie="$(get_cookie $args_file)";
if [[ -n "$new_cookie" ]]; then
cookie=$new_cookie;
fi;
done;
echo $cookie;
}
If I have 2 vm.args files where 1 of the files inherits the cookie from a different file:
file1.vm.args
file2.vm.args
Then the following line in
extended_bin
will not work and will instead use the cookie in~/.erlang.cookie
https://github.com/erlware/relx/blob/d2add7c2fdaa9a26bddfb40455b2000abc16b0c6/priv/templates/extended_bin#L723-L740Even though the recursion is validated a few lines prior https://github.com/erlware/relx/blob/d2add7c2fdaa9a26bddfb40455b2000abc16b0c6/priv/templates/extended_bin#L612-L661