How can I find out what user Hudson is running under
I've taken over handling Hudson from a contractor and I'm wanting to know what user the hudson is running under.
开发者_StackOverflow社区I need this because I've made a new job which will sync a folder with another folder on a mapped drive. This mapped drive is only available to the build user (user as in what you log into windows with, not log into hudson).
The job itself is getting a 'Failed to copy' error in the log which I believe is because i'm using the wrong windows user and there is no mapped drive? Or would this cause another error?
Regards
If linux:
ps -ef | grep hudson
The owner of the process will be shown (along with other info).
It is much easier to do this from within Hudson by going to Manage Hudson > Script Console and adding the following.
println(System.getProperty("user.name"))
Figure out what web server or servlet container (such as Tomcat) Hudson is deployed on. Hudson is a web application and will use the same user as the web server it is deployed on.
It obviously runs as a service, so check what services are defined and what user they run as.
You can also use the task manager and check the "Show processes from all users". There should be a Hudson.exe, check what username it is running under.
I just found out about tasklist and taskkill. So you can also run the following command:
tasklist /fi "IMAGENAME eq hudson.exe"
精彩评论