Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to set an environment variable that will be visible to all processes launched by Upstart. This is on a CentOS system, but I presume the same applies to Ubuntu given that they both use Upstart.

Somewhere in /etc/init/ perhaps?

Note that adding it in /etc/profile.d only applies to login shells. I want all processes (e.g cron, rc.local, etc) to see it.

Obviously I'd prefer not to edit existing sys config files if it can be avoided.

share|improve this question

I believe that /etc/environment should work.

/etc/environment - This file is specifically meant for system-wide environment variable settings. It is not a script file, but rather consists of assignment expressions, one per line. Specifically, this file stores the system-wide locale and path settings.

Ubuntu help

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.