osx - PATH is getting set somewhere other than launchd.conf and I don't know where -


the question of how set path programs in user session (not terminal) has come , been addressed. changed both /etc/launchd.conf , /etc/paths, make sure ok. however, still getting different path envar when launch terminal i'm expecting (i'm not @ sure how test path application.)

here's what's in /etc/launchd.conf:

setenv path /sw/bin:/sw/sbin:/sw/local/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/x11/bin:/opt/local/bin:/opt/local/sbin 

here's what's in /etc/paths:

. $home/bin /sw/bin /sw/sbin /sw/local/bin /usr/bin /bin /usr/sbin /sbin /usr/local/bin 

plus couple of files in /etc/paths.d/:

x11:

/usr/x11/bin 

opt:

/opt/local/bin /opt/local/sbin 

now, when launch fresh terminal is:

miishka:~ tamara$ echo $path  /usr/bin:/bin:/usr/sbin:/sbin:.:/users/tamara/bin:/sw/bin:/sw/sbin:/sw/local/bin:/usr/local/bin:/usr/x11/bin:/opt/local/bin:/opt/local/sbin miishka:~ tamara$  

i've checked .bashrc , .bash_profile, have no .profile, , i've checked /etc/profile , /etc/bashrc , none of them touch path envar.

i'm stumped.

man path_helper 

this thing drove me crazy. use zsh, , in /etc/zshenv found it.

# system-wide environment settings zsh(1) if [ -x /usr/libexec/path_helper ];     eval `/usr/libexec/path_helper -s` fi 

path_helper(8) has useful purpose, think. it's negated usual ultra vague sysadmin info apple. path_helper(8) in shell init file, in /etc, if using macports, am. might help.

otherwise, can try setting environment in:

 /etc/launchd.conf 

but of course, man page not definitive. http://developer.apple.com excellent documentation, want better man pages, not precise memory locations.

finally, can set them on on loginwindow reads:

 ~/.macosx/environment.plist 

now, me, seems odd have several ways this, but... hell, odd. made decent init replacement, 1 process rule them all, nope, many jobs run outside of it. luck. should able $var gui using 1 of these methods.

ah, http://developer.apple.com/library/mac/#qa/qa1067/_index.html.

osx has various sessions , domains. precise,

 man launchctl 

sessions:

currently known session types include: aqua, loginwindow, background, standardio , system.

domains:

look plist(5) files ending in *.plist in domain given. valid domains include "system," "local," "network" , "all."

it makes sense when read it.

ugh. launchd gets me.

edit: https://serverfault.com/questions/16355/how-to-set-global-path-on-os-x/277034#277034

again alleges /etc/launchd.conf files path.

so ran

 opensnoop -g -c -f /etc/launchd.conf 

and opened terminal, iterm, safari, keychain... nada. none of them opened file.

edit: however, after watching google video on launchd ran

 launchctl export  

which showed me

path="/usr/bin:/bin:/usr/sbin:/sbin"; export path; tmpdir="/var/folders/yh/yhfe3+5rhmuxft5hr1xztk+++ti/-tmp-/"; export tmpdir; shell="/opt/local/bin/zsh"; export shell; home="/users/kb"; export home; user="kb"; export user; logname="kb"; export logname; display="/tmp/launch-dcqkbh/org.x:0"; export display; ssh_auth_sock="/tmp/launch-czhyqj/listeners"; export ssh_auth_sock; apple_pubsub_socket_render="/tmp/launch-ti7lbi/render"; export apple_pubsub_socket_render;    sudo launchctl export  

which changes context system context, instead of aqua context user, returned

path="/usr/bin:/bin:/usr/sbin:/sbin"; export path; 

so context matter, in other words, session command run in.

documentation tool, init replacement, important daemon in apple, 1 daemon rule them all, piss poor. piss. poor.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -