Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-9911

JNLP slave JVM options are ignored when installing as a service

      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.

          [JENKINS-9911] JNLP slave JVM options are ignored when installing as a service

          Garen Parham added a comment -

          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).

          Garen Parham added a comment - 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).

          ThiagoC added a comment -

          Same problem here.

          ThiagoC added a comment - Same problem here.

          Daniel Beck added a comment -

          Daniel Beck added a comment - 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 tried it on 1.599 - doesn't work.

          Rasmus Pedersen added a comment - I tried it on 1.599 - doesn't work.

          Oleg Nenashev added a comment -

          I agree the behavior may be unexpected. It needs to be fixed or documented

          Oleg Nenashev added a comment - I agree the behavior may be unexpected. It needs to be fixed or documented

          Oleg Nenashev added a comment -

          Oleg Nenashev added a comment - 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.

           

          <!--
          Windows service definition for Jenkins slave
          
          To uninstall, run "jenkins-slave.exe stop" to stop the service, then "jenkins-slave.exe uninstall" to uninstall the service.
          Both commands don't produce any output if the execution is successful.
          -->
          <service>
          <id>jenkinsslave-c__jenkins</id>
          <name>jenkinsslave-c__jenkins</name>
          <description>This service runs a slave for Jenkins continuous integration system.</description>
          <!--
          if you'd like to run Jenkins with a specific version of Java, specify a full path to java.exe.
          The following value assumes that you have java in your PATH.
          -->
          <executable>C:\Program Files\Java\jre1.8.0_111\bin\java.exe</executable>
          <arguments>-Xrs -jar "%BASE%\slave.jar" -jnlpUrl http://192.168.100.5:8080/computer/test/slave-agent.jnlp -secret 5c0dda278f8249acb70a83dccb040537a413655fb3665cac373f9e0ed3ee3ab1</arguments>
          <!--
          interactive flag causes the empty black Java window to be displayed.
          I'm still debugging this.
          <interactive />
          -->
          <logmode>rotate</logmode>
          
          <onfailure action="restart" />
          </service>

          Ivan Fernandez Calvo added a comment - I tested on 2.46.3 with Windows 2012R2 and the JVM Options are ignored when you install the service from the launch button.   <!-- Windows service definition for Jenkins slave To uninstall, run "jenkins-slave.exe stop" to stop the service, then "jenkins-slave.exe uninstall" to uninstall the service. Both commands don't produce any output if the execution is successful. --> <service> <id>jenkinsslave-c__jenkins</id> <name>jenkinsslave-c__jenkins</name> <description>This service runs a slave for Jenkins continuous integration system.</description> <!-- if you'd like to run Jenkins with a specific version of Java, specify a full path to java.exe. The following value assumes that you have java in your PATH. --> <executable>C:\Program Files\Java\jre1.8.0_111\bin\java.exe</executable> <arguments>-Xrs -jar "%BASE%\slave.jar" -jnlpUrl http: //192.168.100.5:8080/computer/test/slave-agent.jnlp -secret 5c0dda278f8249acb70a83dccb040537a413655fb3665cac373f9e0ed3ee3ab1</arguments> <!-- interactive flag causes the empty black Java window to be displayed. I'm still debugging this . <interactive /> --> <logmode>rotate</logmode> <onfailure action= "restart" /> </service>

            Unassigned Unassigned
            awaragi awaragi
            Votes:
            9 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: