-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EnvPane is not setting environment variable PATH #5
Comments
Thank you for your detailed issue report, Uwe. PATH is special because the system has to take security constraints into account. I might not be able to work around those constraints in EnvPane. It seems that PATH is not controlled by the user-specific launchd instance (the one my agent talks to), but rather by root's launchd instance, i.e. the one with PID 1. I could make the agent talk to the root instance but that would require asking the user (assuming they're an admin) for their password. It would have the same effect as setting PATH in Please note that there are more subtleties involving PATH with respect to shell sessions, e.g. Terminal.app. Here PATH is controlled largely by path_helper(8) which reorders the entries in PATH to the effect that custom entries appear at the end. You can verify this by running
You say that your Java test app prints the PATH with the custom entries prepended. To me this indicates that you are not starting it from a shell, otherwise the custom entries would appear at the end. Am I correct? Nevertheless, I am still confounded by the log snippet you posted. It should contain a line generated by the agent that says
Could you make sure you tested the latest version of EnvPane (v0.3)? To summarize and to aid in your diagnostics,
prints the current user's launchd environment, the one that affects that user's GUI apps.
prints the global launchd instance's environment. Its PATH overrides the user-specific one. The overriding seems to happen at login time.
prints the shell's environment, which is further scrambled by path_helper(8). |
I have been stumbled already about
Before I filed the bug report - I downloaded the latest I get the following output with an empty
|
If I just step back and lock at the issue from a users point of view, it seems to me setting the I totally understand you to not end up in maintenance nightmare here, because of all the mess Apple created here. Ok, this is how I would do it:
A completely different solution would be to to deal with 2 sets of environments This approach would delegate the whole |
I really like the second approach of having two different scopes. I stumbled upon EnvPane while looking for a graphical solution to modify |
If I put the following in
/etc/launchd.conf
:As a consequence of that
PATH
for Applications gets modified from:to
If I comment the line from above in
/etc/launchd.conf
, reboot and use EnvPane to set thePATH
, thePATH
does not get prefixed with/opt/local/bin:/opt/local/sbin:
in normal applications. As far as I can see EnvPane is creating:in my
$HOME
with the following content:But it looks like OS X does not use the content of
~/.MacOSX/environment.plist
. Is there something wrong with your agent?How do I test? I wrote a small Java program dumping put the
PATH
as follows:My expectation of EnvPane is to get the environment variable in my application exact the same way as I defined it in EnvPane itself, without rebooting my box, Please correct my if I am wrong.
I found the following output in my logfiles while filtering for
net.hannesschmidt
:Just tell me if you need more details or some other information. I am running 10.8.3 at the moment.
The text was updated successfully, but these errors were encountered: