0

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"

1

For anyone from the future ..

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

<ProgramArguments>
    <array>
        <string>java</string>
        <string>-jar</string>
        <string>jenkins.war</string>
    </array>

... to ...

<ProgramArguments>
    <array>
        <string>bash</string>
        <string>-l</string>
        <string>-c</string>
        <string>java -jar jenkins.war</string>
    </array>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .