Version 1.498 has a stronger defense that can break Jenkins' slavery as a service.
https://issues.jenkins-ci.org/browse/JENKINS-16273
Recommendations include:
- Stop service
- Delete the service if dos exists (
sc delete jenkinsslave-C__Jenkins ) - Delete the old jenkins-slave.exe, slave.jar and jenkins-slave.xml
- Launch the web client and let it install the service
- Edit jenkins-slave.xml so it looks like this: the important part is jnlpCredentials
<arguments>-Xrs -jar "%BASE%\slave.jar" -jnlpCredentials <user>:<password> -jnlpUrl http://<your server>/computer/<slave name>/slave-agent.jnlp</arguments>
I found that removing slave.jar and starting the web client when the user logged in worked better, you get the secret and donβt need to edit the XML.
If I do not delete slave.jar, then I found that editing jenkins-slave.xml and deleting secret in arguments works without any credentials at all (security hole?). See Jenkins-slave.err
"-secret" is not a valid option
<strong> jenkins-slave.xml
... <service> <id>jenkinsslave-D__Jenkins</id> <name>Jenkins Slave</name> ... <executable>C:\Program Files\Java\jre7\bin\java.exe</executable> <arguments>-Xrs -jar "%BASE%\slave.jar" -jnlpUrl http://jenkins.domain/jenkins/computer/mycomputername/slave-agent.jnlp </arguments> ...
source share