I'm wondering how to load bashrc
variables in an upstart script and run (node.js
in that case server).
What is the best way to do it?
I tried this:
exec sudo -u someuser $NODE_PATH $FULL_PATH/$FILE_NAME >> /var/log/$PROGRAM_NAME.sys.log 2>&1
and this
exec start-stop-daemon --start -c someuser --exec $NODE_PATH $FULL_PATH/$FILE_NAME >> /var/log/$PROGRAM_NAME.sys.log 2>&1
But in the first option the node app can't read the http_proxy
variable (which is defined in /etc/bash.bashrc
). In the second one it can't read config files (the node app is installed in the /opt
folder)