The Cellar  

Go Back   The Cellar > Main > Technology

Technology Computing, programming, science, electronics, telecommunications, etc.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 05-27-2004, 12:31 PM   #3
Pie
Gone and done
 
Join Date: Sep 2001
Posts: 4,808
Aha! I think I found exactly what you're looking for:

http://developer.apple.com/qa/qa2001/qa1067.html

Q: How do I set environment for all processes launched by a specific user?

A: It is actually fairly simple process to set environment variables for processes launched by a specific user.

There is a special environment file which loginwindow searches for each time a user logs in. The environment file is: ~/.MacOSX/environment.plist (be careful it's case sensitive). Where '~' is the home directory of the user we are interested in. You will have to create the .MacOSX directory yourself using terminal (by typing mkdir .MacOSX). You will also have to create the environment file yourself. The environment file is actually in XML/plist format (make sure to add the .plist extension to the end of the filename or this won't work). An example environment file is shown below. The file was created using /Developer/Applications/PropertyListEditor.app

[see below]

Here the environment variables TestEnvironmentVariable and MrX are set to /My/Value and 1 respectively, every time that specific user logs in. You can add more environment variables by adding new siblings to the property list using the 'New Siblings' button shown above.

Note that the key class must be string. If any other class is used the key will not be recognized by loginwindow. You can confirm the environment variables have been set as expected by typing setenv into terminal.
Attached Images
 
__________________
per·son \ˈpər-sən\ (noun) - an ephemeral collection of small, irrational decisions
The fun thing about evolution (and science in general) is that it happens whether you believe in it or not.
Pie is offline   Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -5. The time now is 04:01 AM.


Powered by: vBulletin Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.