Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I know they get read from /etc/env.d/ but I tried adding in my own file in there (00example) with a single env variable but they aren't picked up after either env-update.

How does a user declare them globablly and why did my method not work?

linux 3.0.6

share|improve this question

2 Answers 2

up vote 1 down vote accepted

See http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=5 : you need to run env-update so that your file gets merged into /etc/profile.env.

share|improve this answer
    
I ran env-update nothing happened. –  rutherford Dec 21 '11 at 14:20
    
what about env-update && source /etc/profile ? Check that your variable is stored in /etc/profile.env... –  chickenkiller Dec 21 '11 at 14:21
    
that worked cheers - what's the reason? –  rutherford Dec 21 '11 at 14:43
    
maybe your /etc/profile is not sourced at boot... did you log in as root? Maybe /etc/profile is handled differently for root user... Not sure... –  chickenkiller Dec 21 '11 at 14:45
1  
The file /etc/profile is only read when a login shell is starting up. Changes to it will not take effect automatically; you need to log in again, or do source /etc/profile manually. –  Kevin Panko Dec 21 '11 at 15:35

If you created the file /etc/env.d/00example, it would only get set when you attempt to run the command example. Are you sure you aren't looking for setting variables in /etc/env.d/99local (or /etc/profile)?

share|improve this answer
    
the file name has nothing to do with commands typed later. /etc/env.d is only used to organise global environment variables in several files for clarity. –  chickenkiller Dec 21 '11 at 14:19
    
maybe - what's 99local? It's not in my system at the moment –  rutherford Dec 21 '11 at 14:24
    
It's what the docs say to stick system wide user variables, but chickenkiller is right, the names doesn't matter, just the order that they get created/appended. Out of curiosity, what variable did you attempt to set? –  Jon Lin Dec 21 '11 at 14:35
    
also, make sure the files starts with 2 real digits (0 and not O for example), the python code that parses your file is touchy about it... see github.com/funtoo/portage-funtoo/blob/stable/pym/portage/util/… –  chickenkiller Dec 21 '11 at 14:40

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.