This questions stems from @FrustratedWithFormsDesigner comment.
How do I make export
environment variables set within an init.d script available to downstream processes started within that same init.d script?
In more detail, I am on an Amazon EC2 instance and using an init.d script to control my node
.js server that is in turn controlled by nodemon
which monitors for file changes and restarts node
as needed. So in short, my init.d script starts nodemon
which then starts node
. Environment variables set with export
within the init.d script seem to be available to nodemon
, but unavailable to node
. How do I make these environment variables available to node
as well?
Currently, only init.d is available in my Amazon EC2 instance so is this even possible with init.d scripts, and if not, is this possible with upstart or preferably systemd?
nodemon
should be handling the environment variables and not the init.d script itself. For this reason and others, I have switched topm2
which is far better thannodemon
at handling environment variables. – Marc A Jun 05 '16 at 16:26