Starting Jenkins via commandline and use configuration of the windows service

1,987 views
Skip to first unread message

newInHere

unread,
May 18, 2015, 10:40:55 AM5/18/15
to jenkins...@googlegroups.com
Hello Jenkins Users,

im using jenkins on windows and i´ve read when jenkins is running as a windows service, it´s not possible to spawn proccesses correctly which have GUI´s.

So i deactivated jenkins as windows service and i´ve created a batch to start Jenkins.
The batch itself works and jenkins will´be started. But now i have a complete empty jenkins. It looks like i´ve completly reinstalled jenkins.
When i terminate the batch and start jenkins as windows service again, all my settings and jobs are existing.

Is it possible to take the same configuration of the windows-service when i start jenkins via batch ? Maybe i´ve overead something.. 

Thank you very much !



My batch for starting jenkins (the batch is also in included in $JENKINS-HOME Dir ):

SET BASE=C:\APP\Tools\jenkins
%BASE%\jre\bin\java -Djava.net.preferIPv4Stack=true -Xrs -Xmx256m -jar "%BASE%\jenkins.war" --httpPort=8080


Links:
Infos for starting Jenkins as windows service:
Infos for starting Jenkins via commandline:





Richard Bywater

unread,
May 18, 2015, 3:05:34 PM5/18/15
to jenkins...@googlegroups.com

Not sure where you've heard there are problems with using Jenkins and processes that start GUIs when using a service - all you should need to do is make sure that the service has had the "interact with desktop" turned on which (if I recall correctly means that you need an actual user account to run it as - as opposed to the "local system account" option)

Sorry for being hazy but it has been a while and not in front of my machine at the moment.

Richard


--
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 jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/6b933ca4-0990-4fef-992f-4f61f046c631%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

newInHere

unread,
May 19, 2015, 2:56:26 AM5/19/15
to jenkins...@googlegroups.com
Thank you for your quick advice. Unfortunately i can´t run the service with the local user account on the jenkins server and so it´s not possible to activate the "interact with desktop" but thanks for your help, i haven´t known that before.


So is it possible to run jenkins from commanline with the settings / configuration of jenkins windows service ?

Thanks
Michael

newInHere

unread,
May 19, 2015, 3:51:39 AM5/19/15
to jenkins...@googlegroups.com
Ok i have solved my problem to run jenkins via cmd with the settings from the jenkins service. By the way i use Windows 7 i haven´t mentioned that.

If you run Jenkins as a windwos service all Configrations, Jobs and Plugins are installed directly in the %JENKINS_HOME% Dir (e.g "C:\ProgramFiles\Jenkins").
If you run Jenkins via Commandline there will be created an Configuration Dir in "C:\Users\<USER_NAME>\.jenkins". Within this dir there are created subdirs for plugins, jobs etc. , too.
So i´ve synchronized all dir and files in "C:\Users\<USER_NAME>\.jenkins". with the content of these files and dirs in %JENKINS_HOME% Dir and it works for me.




Reply all
Reply to author
Forward
0 new messages