Kyorai / riak_core

Distributed systems infrastructure used by Riak.
Apache License 2.0
101 stars 23 forks source link

run_user_home - what does it do, how can I set it? #31

Closed ghost closed 6 years ago

ghost commented 6 years ago

https://github.com/Kyorai/riak_core/blob/c8ebdb0c2bb8fde01196f0dc63615f70e480a8d9/priv/riak_core.schema#L654-L658

I'm getting startup error in Tanodb relating to the above code ^

08:17:18.047 [error] Caught exception:
undef
[{lager,warn,["Home !!! ~p",[[]]],[]},{setup,verify_directories,0,[{file,"/bryanhuntesl/tanodb/_checkouts/setup/src/setup.erl"},{line,229}]},{setup,run_setup_,0,[{file,"/bryanhuntesl/tanodb/_checkouts/setup/src/setup.erl"},{line,868}]},{setup,run_setup,0,[{file,"/bryanhuntesl/tanodb/_checkouts/setup/src/setup.erl"},{line,859}]},{setup_srv,handle_call,3,[{file,"/bryanhuntesl/tanodb/_checkouts/setup/src/setup_srv.erl"},{line,40}]},{gen_server,try_handle_call,4,[{file,"gen_server.erl"},{line,636}]},{gen_server,handle_msg,6,[{file,"gen_server.erl"},{line,665}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]

It was failing with just the exception but I modified setup.erl (from https://github.com/uwiger/setup/ ) to print the variable it was configured for. In this case, I'm trying to run it as a devrel

Licenser commented 6 years ago

This is a general issue with startup, you need to set the home directory to prevent it to error on starutp. the {{run_user_home}} can be set as an overlay.

ghost commented 6 years ago

Thanks @Licenser - that can be any directory to which the process has the right to write, is that correct ? It's not the data directory as that's already specified with platform_data_dir.

Licenser commented 6 years ago

yes it can be pretty much whatever directory you want, it's not even used for anything as far as I know, setup just insists on checking for it.

ghost commented 6 years ago

Thanks - fixed it in my vars.config file with the following -

{run_user_home,     "$HOME"}. 
Licenser commented 6 years ago

Oh that's a really neat trick! I got to remember that :) thanks!