Files
2012-02-21 01:15:00 -05:00

1 line
3.3 KiB
JSON

[{"user_id": 10074, "stars": [], "topic_id": 16034, "date_created": 1301409868.3441629, "message": "I need it atm for Ubuntu and later on another Linux System (but I think if it works on Ubuntu, it should work there too)", "group_id": 292, "id": 469771}, {"user_id": 10074, "stars": [], "topic_id": 16034, "date_created": 1301409424.0628431, "message": "Hey,\nI'm working on a script which needs to set a global environment variable. os.environ['var'] doesn't do what I need. How can I do this?", "group_id": 292, "id": 469690}, {"user_id": 5266, "stars": [], "topic_id": 16034, "date_created": 1301409728.312465, "message": "In Windows: write it to the registry and then broadcast the change", "group_id": 292, "id": 469754}, {"user_id": 1736, "stars": [], "topic_id": 16034, "date_created": 1301416595.2145541, "message": "@Samuirai Make a file in /etc/profile.d and then restart the machine", "group_id": 292, "id": 470648}, {"user_id": 1736, "stars": [], "topic_id": 16034, "date_created": 1301422955.2264991, "message": "If you just want to set something for all _future_ processes, then yes, you don't need to restart anything", "group_id": 292, "id": 471261}, {"user_id": 1736, "stars": [], "topic_id": 16034, "date_created": 1301422893.3200221, "message": "@kseistrup Actually yes, if you want to spread the variable to all processes you need to restart all processes (which is effectively the same as restarting the box)", "group_id": 292, "id": 471248}, {"user_id": 8558, "stars": [], "topic_id": 16034, "date_created": 1301422823.8906939, "message": "@coderanger OP is on Linux, not Windows \u2014 no need to restart.\n@samurai If you mean global as in system environment variable, you can set KEY=VAL pairs in /etc/environment. You should probably also take a look at pam_env(8).", "group_id": 292, "id": 471229}, {"user_id": 1736, "stars": [{"date_created": 1301499379.261703, "user_id": 20326}, {"date_created": 1301572813.7490461, "user_id": 26840}], "topic_id": 16034, "date_created": 1301422910.718528, "message": "There is \"no\" way to affect the env variables of a running process other than the current one", "group_id": 292, "id": 471253}, {"user_id": 10074, "stars": [], "topic_id": 16034, "date_created": 1301471888.244772, "message": "The problem is, that my scripts just starts other processes. If I set the os.environ var in my start script, the var is not known in the new processes. Atm I set the env variable global, but I think this should be my permanent solution.", "group_id": 292, "id": 479485}, {"user_id": 16551, "stars": [{"date_created": 1301554802.4507959, "user_id": 1736}], "topic_id": 16034, "date_created": 1301536497.094408, "message": "@davisp Setting something in os.environ should do an implicit os.putenv. What you will not see in os.environ however is anything set using C level putenv as os.environ is only populated from C level environ on process/sub interpreter startup.", "group_id": 292, "id": 486877}, {"user_id": 1736, "stars": [], "topic_id": 16034, "date_created": 1301554814.5167251, "message": "In fact forget os.putenv exists", "group_id": 292, "id": 489494}, {"user_id": 507, "stars": [], "topic_id": 16034, "date_created": 1301533958.6186719, "message": "You're hitting the issue that os.environ is not a live map of the environment. You want to use os.putenv", "group_id": 292, "id": 486432}]