How do I reload an OS X "bash" user-environment I think that I want to ask


How do I reload an OS X bash user-environment


But damnit Jim ; I'm a software engineer not a sysadmin

The Goal


I want Jenkins started as a Daemon on El Capitan
I want to use "UserWhoHasARealAccount" on OS X
For this I should be using a launch-daemon


AFAIK


all /Library/LaunchDaemons/ are started as root
While they can substitute-user with User to become not-root they still retain root's environment.


The Problem


process won't have the full PATH (et al) that I setup


which can work around this but ...

sub processes don't get the PATH I setup for the user


so which whatever-i-want doesn't help when Node.JS tries to run a subprocess and compile my blog ... unless I for Node.JS to invoke subprocesses via absolute paths on my computer

the root environment seems to prevent ssh from working


so I can't have have "UserWhoHasARealAccount" login to localhost to magically get a real path
I may be missing something since I can't find any SSH error messages



Since this is a server, logging in and pressing a button won't "do it for me"
For anyone from the future ..

bash can be run with -l to execute full login goodies.
So, my launchd script goes from;

&lt;ProgramArguments&gt;
    &lt;array&gt;
        &lt;string&gt;java&lt;/string&gt;
        &lt;string&gt;-jar&lt;/string&gt;
        &lt;string&gt;jenkins.war&lt;/string&gt;
    &lt;/array&gt;


... to ...

&lt;ProgramArguments&gt;
    &lt;array&gt;
        &lt;string&gt;bash&lt;/string&gt;
        &lt;string&gt;-l&lt;/string&gt;
        &lt;string&gt;-c&lt;/string&gt;
        &lt;string&gt;java -jar jenkins.war&lt;/string&gt;
    &lt;/array&gt;