So I have an application I am deploying to an Ubuntu 12 server. My application has several "parts" to it:
There's a web server, run as part of an upstart script There are cron jobs There are sometimes command-line utilities which I want to run when ssh-ing into the production machine
What I want is a single place to specify a list of environment variables (
MY_APP_CONFIG_1, etc...), which will be picked up by all of those above-mentioned "parts": by the upstart script, by the cron jobs, by the login shell when I ssh into the machine.
1) Where's the right place to place these? Specifically -- is it
/etc/environment? Isn't that only for login sessions?
2) If it is
/etc/environment -- I notice I can't use substitutions there, or run logic. Is there any place I can do that? A set of shell commands that get source'd?