I print the PATH inside the subshell, just before running “java –jar slave.jar 
...”, and it’s correct.  The build job, when it does not manually set the PATH, 
gets an incorrect PATH, so the build job fails.  When the build job is changed 
to manually set the PATH, it works fine.

I know that subprocesses inherit the environment of the parent, but I believe 
that build jobs run on a jenkins slave do not inherit the environment of the 
process that ran the slave.  I believe that jobs need to specify their own 
PATH, or perhaps get a PATH setting for the node in the Jenkins master (which 
is not the same as the PATH used to run the slave).  I believe this makes more 
logical sense than setting the environment for all the build jobs on a slave by 
setting the environment of the process that runs the slave.

From: [email protected] 
[mailto:[email protected]] On Behalf Of Richard Bywater
Sent: Monday, April 20, 2015 1:34 PM
To: [email protected]
Subject: Re: Proper way to set job PATH with OpenStack Job Builder

The job should AFAIK inherit the PATH of the environment that is calling Java 
to start the slave.
If you can describe what issue you are seeing then we may be able to assist?
Richard.

On Tue, 21 Apr 2015 at 03:43 KARR, DAVID 
<[email protected]<mailto:[email protected]>> wrote:
I have a question or two about proper job definition using the "Job Builder" 
facility that was developed for OpenStack, which is defined at: 
http://ci.openstack.org/jenkins-job-builder/ .

I would ask about this in the OpenStack community, but I'd like to hear what 
the Jenkins community might say about this.

Specifically, I'd like to be clear on the proper way to set the correct 
environment (PATH) for a build job that runs on a JNLP-connected slave.

I was first under what I believe was a mistaken impression, which was that the 
PATH for a build job is taken from the PATH of the script that runs "java -jar 
slave.jar".  I'm fairly certain that's wrong, but I'm having trouble finding a 
straight answer on the proper strategy for this.

--
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:jenkinsci-users%[email protected]>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/B8D164BED956C5439875951895CB4B22283E0675%40CAFRFD1MSGUSRIA.ITServices.sbc.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAMui946Qiu_i05P3F1Uogy4CUR5eXssTE3NOQ_C9mBjwMdt-xw%40mail.gmail.com<https://groups.google.com/d/msgid/jenkinsci-users/CAMui946Qiu_i05P3F1Uogy4CUR5eXssTE3NOQ_C9mBjwMdt-xw%40mail.gmail.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/B8D164BED956C5439875951895CB4B22283E30B4%40CAFRFD1MSGUSRIA.ITServices.sbc.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to