5

I browsed a lot on this topic. There are different variations of this question or no answer to fix my issue. Any help is appreciated.

  1. I have installed firefox on my VM as root in /usr/bin/firefox.
  2. I downloaded the maven project to run selenium tests, and run it manually on my VM using mvn clean install command. This opens the browser and also successfully runs the test.
  3. Now I run Jenkins as myself ( JAVA_HOME is /usr/java/latest and started the service as nohup java -jar jenkins.war --httpPort=-1 --httpsPort=8082; version is 1.522).
  4. Create a new freestyle s/w project; Configure the job to download the maven project and invoke maven target 'clean install';
  5. When I run the job, I can see the steps in the console output but the browser is not opening. It also locks up my AD account.

Why is this happening? What is the fix?

user1164061
  • 4,222
  • 13
  • 48
  • 74

1 Answers1

2

nohup runs Jenkins in the background (http://en.wikipedia.org/wiki/Nohup), in which case according to this post Jenkins will start the browser in the background as well.

Try starting jenkins without nohup so that it runs in the foreground (java -jar jenkins.war --httpPort=-1 --httpsPort=8082).

Or you can start Jenkins as a daemon (this Jenkins Wiki page contains an example of init script). When Jenkins is started as daemon, the browser started by its job is visible.

Community
  • 1
  • 1
ikostenko
  • 21
  • 2
  • so how can I have the benefit of both nohup and jenkins displaying firefox in the foreground? In a professional environment nohup is a must so that we dont have to start Jenkins for users everyday. (or) if firefox runs in the background silently, its locking my account for some reason. If I can overcome that , then I can use nohup as well as run firefox in the background. Any input on that? – user1164061 Aug 06 '13 at 22:06
  • The answer has been edited with another option to start Jenkins – ikostenko Aug 07 '13 at 07:52
  • Most pre-packaged versions of jenkins (RPM, deb, pkg, etc) will be configured properly for starting jenkins as a daemon. Another way to start jenkins as a daemon is to use the (little documented) --daemon argument. Any reason you are making your own service wrapper? The wiki should probably be updated. – coffeebreaks Aug 12 '13 at 08:49