I’m trying to call an external (python) script with System.cmd/3, and I’m seeing some strange behavior with respect to the environment variable HOME (Linux/Mac).
System.get_env("HOME") gives me /Users/mteter on my Mac. This is correct. System.get_env("HOME") gives me /home/mteter/work/projects/webapp on my production Linux box.
Further, if I call a shell script via System.cmd/3 on my prod Linux box, the script believes $HOME is that wrong one above. Same goes for ~.
Does your startscript fiddle around with $HOME? What does env | grep HOME say, run in a terminal before starting the app, then starting the app and observing its behaviour and then shutting it down and trying env | grep HOME again?
That’s because nothing would, this would be handled by the environment that is doing the launching of the BEAM, what environment is that, how do you do it, what is $HOME inside of ‘that’ environment?
Too much going on, and I forgot that I have a separate launch script. I guess the “complexity” of the release stuff, which I haven’t yet learned, distracted me from the obvious.
That’s true. And often explaining the problem on hand to someone or like you did on forum @michael_teter actually helps track it down. We absolutely don’t mind.