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]):
----
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