Open timja opened 13 years ago
For me this also happens if the launch method is "Let Jenkins control this Windows slave as a Windows service."
Jenkins should use the JDK/JRE path to java.exe already installed on the slave system if present, if it did it would also fix JENKINS-6957 for me (system couldn't find java.exe without manually hacking jenkins-slave.xml or adding C:\Windows\SysWOW64 to PATH).
Did anyone try this recently? Did it work? From a cursory reading of the sources, this appears to still be unresolved as of 1.584 or so:
https://github.com/jenkinsci/windows-slave-installer-module/blob/master/src/main/java/org/jenkinsci/modules/windows_slave_installer/WindowsSlaveInstaller.java#L97
https://github.com/jenkinsci/windows-slave-installer-module/blob/master/src/main/resources/org/jenkinsci/modules/windows_slave_installer/jenkins-slave.xml
No VMARGS are set, so no way to add anything between -Xrs and -jar.
I agree the behavior may be unexpected. It needs to be fixed or documented
For newly installed agents it should work correctly: https://github.com/jenkinsci/windows-slave-installer-module/blob/master/src/main/resources/org/jenkinsci/modules/windows_slave_installer/jenkins-slave.xml#L44 . Works for me at least
I tested on 2.46.3 with Windows 2012R2 and the JVM Options are ignored when you install the service from the launch button.
jenkinsslave-c__jenkins jenkinsslave-c__jenkins This service runs a slave for Jenkins continuous integration system. C:\Program Files\Java\jre1.8.0_111\bin\java.exe -Xrs -jar "%BASE%\slave.jar" -jnlpUrl http://192.168.100.5:8080/computer/test/slave-agent.jnlp -secret 5c0dda278f8249acb70a83dccb040537a413655fb3665cac373f9e0ed3ee3ab1 rotate "restart" />
[Originally duplicated by: JENKINS-9908]
[Originally duplicated by: JENKINS-9909]
[Originally duplicated by: JENKINS-9910]
[Originally related to: JENKINS-2452]
[Originally related to: JENKINS-16061]
Under node configuration, advanced launch options, JVM options are not copied to the jenkins-slave.xml file after executing install windows service function. We can work around this issue by manually editing the jenkins-slave.xml file.
Originally reported by awaragi, imported from: JNLP slave JVM options are ignored when installing as a service