I am trying to setup AWS instance Windows-based Jenkins slave servers, 
totally headless via a Scalr/Chef cookbook deployment system. I have nearly 
everything working for the cookbook and its recipes for obtaining the 
information from the encrypted Chef data bag for setting up the 
configurations needed for each slave (as there will be several).

Since no one is actually logging into the actual server, opening a command 
window and then using the applet to 'install as a service' is not an 
option. So I was attempting to use the "Install Slave as a Windows service 
(cmd version)" instruction. I got the code to register as a service, but it 
won't start. I logged into the slave server instance and attempted to start 
the service and it reports this error: 

"Windows could not start the JenkinsSlave service on Local Computer."
"Error 1053: The service did not respond to the start or control request in 
a timely fashion."

---

Some of the Chef cookbook code to get an idea how I am setting up the 
Jenkins slave environment...

# Jenkins Service - Install as a Service
execute 'jenkins-slave-service' do
  command "C:\\Windows\\System32\\sc.exe create \"JenkinsSlave\" binPath= 
\"C:\\ProgramData\\Oracle\\Java\\javapath\\java.exe -jar 
E:\\jenkins-slave\\slave.jar -jnlpUrl #{jnlp_url} -secret #{slave_secret}\""
  not_if { ::Win32::Service.exists?("JenkinsSlave") }
end


The actual result of the execute shows up like this (after the recipe is 
deployed/service installed [code sanitized]):

C:\ProgramData\Oracle\Java\javapath\java.exe -jar 
E:\jenkins-slave\slave.jar -jnlpUrl 
http://xxx.xxx.com/jenkins/computer/tr-eservices-cicd-dev-1/slave-agent.jnlp 
-secret 
abc123abc123


----

Even though I would like to get this windows server working, I an open to 
alternative solutions. From what I read, the cmd version seems to be rather 
'old' and there is talk of a jenkins-slave.exe, but I cannot find the 
executable anywhere in any of the zip packages. Now I did stumble upon 
something called WinSW (https://github.com/kohsuke/winsw), but I get lost 
when trying to see how I can use the JNLP (which is a strict requirement) 
to connect to the Jenkins master. 

Can anyone provide step by step instructions on what I need to do using the 
WinSW method or resolve my Windows Service method I tried above?

-- Michael

-- 
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/78922dd7-ef06-4b43-8198-3682da877107%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to