Quantcast

What user does a build run under?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

What user does a build run under?

Ronan Mulvaney
Sorry if this has been asked before I can't seem to find anything that matches exactly my scenario.
 
I am using Jenkins 1.483 and trying to a job to run a batch file on my local Windows 7 system to gain experience with using Jenkins and how we would automate our builds.
I don't have anything additional set in the out of the box version of Jenkins other than a job and build pointing at this batch file.
 
The first thing this batch file does, is invoke a vbs script on a machine within our Active directory secured network.
This works fine from the command line however when run through Jenkins it seems to run under a different user and hence I cannot access the network.
 
The error seen is simply:
The password is invalid for \\\<network machine>\<directory>
Enter the user name for '<network name>': System error 1223 has occurred.
from a
call cscript \\<network machine>\<directory>\file.vbs invocation
 
I would like the build process to be run by the user that started the Jenkins process/service rather than add Security to Jenkins and have it use the user that invoked the build (where this may differ - in my case right now these of course are just me in both cases). That said I did try and secure Jenkins and add the active directory plugin and run the build again under my login and still got the same failure so I guess I am just missing somewhere that indicates what user a build should be invoked under.
 
Thanks in advance for any advice here.
 
Ronan
 
 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: What user does a build run under?

Scott Evans
Ronan,

My guess is that you have the agent configured to run as a service, rather than a java process on the desktop.  If so, you'll need to set that service to run as a specific user rather than local system account.  That can be found under the LogOn tab of the jenkins service in question.

Scott

On Wed, Sep 26, 2012 at 10:50 AM, Ronan Mulvaney <[hidden email]> wrote:
Sorry if this has been asked before I can't seem to find anything that matches exactly my scenario.
 
I am using Jenkins 1.483 and trying to a job to run a batch file on my local Windows 7 system to gain experience with using Jenkins and how we would automate our builds.
I don't have anything additional set in the out of the box version of Jenkins other than a job and build pointing at this batch file.
 
The first thing this batch file does, is invoke a vbs script on a machine within our Active directory secured network.
This works fine from the command line however when run through Jenkins it seems to run under a different user and hence I cannot access the network.
 
The error seen is simply:
The password is invalid for \\<network machine>\<directory>
Enter the user name for '<network name>': System error 1223 has occurred.
from a
call cscript \\<network machine>\<directory>\file.vbs invocation
 
I would like the build process to be run by the user that started the Jenkins process/service rather than add Security to Jenkins and have it use the user that invoked the build (where this may differ - in my case right now these of course are just me in both cases). That said I did try and secure Jenkins and add the active directory plugin and run the build again under my login and still got the same failure so I guess I am just missing somewhere that indicates what user a build should be invoked under.
 
Thanks in advance for any advice here.
 
Ronan
 
 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

RE: What user does a build run under?

Mandeville, Rob
In reply to this post by Ronan Mulvaney

A build is run under the user account that the slave is under.  If you launch your slaves from the master, that’s the same as the user the Jenkins server is running under (unless the slave launcher is changing the user on the fly—I do that on my Linux setup using sudo).  If you’re using JNLP or launching headlessly (see https://wiki.jenkins-ci.org/display/JENKINS/Distributed+builds), the job will run as whatever user is launching the slave.

 

There’s a possible security concern here.  If the Jenkins server is running as user Fred, and the slave is set up as user Barney, then whoever controls the server can execute arbitrary commands as user Barney through the slave.  This may or may not be a bad thing, just be aware of it.

 

--Rob

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Ronan Mulvaney
Sent: Wednesday, September 26, 2012 11:51 AM
To: [hidden email]
Subject: What user does a build run under?

 

Sorry if this has been asked before I can't seem to find anything that matches exactly my scenario.

 

I am using Jenkins 1.483 and trying to a job to run a batch file on my local Windows 7 system to gain experience with using Jenkins and how we would automate our builds.

I don't have anything additional set in the out of the box version of Jenkins other than a job and build pointing at this batch file.

 

The first thing this batch file does, is invoke a vbs script on a machine within our Active directory secured network.

This works fine from the command line however when run through Jenkins it seems to run under a different user and hence I cannot access the network.

 

The error seen is simply:

The password is invalid for <a href="file:///\\%3cnetwork%20machine%3e\%3cdirectory"> \\<network machine>\<directory>
Enter the user name for '<network name>': System error 1223 has occurred.

from a

call cscript <a href="file:///\\%3cnetwork%20machine%3e\%3Cdirectory"> \\<network machine>\<directory>\file.vbs invocation

 

I would like the build process to be run by the user that started the Jenkins process/service rather than add Security to Jenkins and have it use the user that invoked the build (where this may differ - in my case right now these of course are just me in both cases). That said I did try and secure Jenkins and add the active directory plugin and run the build again under my login and still got the same failure so I guess I am just missing somewhere that indicates what user a build should be invoked under.

 

Thanks in advance for any advice here.

 

Ronan

 

 

The information in this message is for the intended recipient(s) only and may be the proprietary and/or confidential property of Litle & Co., LLC, and thus protected from disclosure. If you are not the intended recipient(s), or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any use, dissemination, distribution or copying of this communication is prohibited. If you have received this communication in error, please notify Litle & Co. immediately by replying to this message and then promptly deleting it and your reply permanently from your computer.
Loading...