Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.