How to kept Jenkins agent online after windows reboot

Hello All

I have a jenkins master based on linux and two agent machine on windows 10 , earlier i used java jnlp launcher to launch my agent but after going to openwebstart the jnlp file launched via openwebstart wont keep connected my agent , it terminate the agent soon after it gets connected and prompt the following error

Nov 09, 2021 9:53:03 AM org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver resolve
INFORMATION: Remoting server accepts the following protocols: [JNLP4-connect, Ping]
Nov 09, 2021 9:53:03 AM org.jenkinsci.remoting.protocol.impl.BIONetworkLayer$Reader run
INFORMATION: Waiting for ProtocolStack to start.
Nov 09, 2021 9:53:08 AM hudson.remoting.UserRequest perform
WARNUNG: LinkageError while performing UserRequest:hudson.slaves.SlaveComputer$SlaveInitializer@6cfcc55d
at hudson.slaves.SlaveComputer$
at hudson.slaves.SlaveComputer$
at hudson.remoting.UserRequest.perform(
at hudson.remoting.UserRequest.perform(
at hudson.remoting.Request$
at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(
at Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$ Source)
at hudson.remoting.Engine$1.lambda$newThread$0(
at Source)
Caused by: access denied (“java.util.PropertyPermission” “hudson.util.RingBufferLogHandler.defaultSize” “read”)
at Source)
at Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at Source)
at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
at java.lang.System.getProperty(Unknown Source)
at java.lang.Integer.getInteger(Unknown Source)
at java.lang.Integer.getInteger(Unknown Source)
at hudson.util.RingBufferLogHandler.(
… 11 more

Just because of this issue every time i have to manually run agent.jar file via command prompt in order to online my agent after my agent machine reboots

I have a job on both my agent machine to reboot and after reboot jobs completed both my agent went offline until i have to manually connect them via running agent.jar file on cmd

My question is : Is there is any way to keep my agent online automatically after my agent machine reboots and i can get rid of this manual exercise of running agent file via cmd

Note: I dont want to run jenkins as a service bc i run automation tests using Ranorex Studio and it requires full interactive control on machine that is why running jenkins as a windows service is not a option for me
Jenkins version: 2.320
JDK version on Master and both agents: JDK 1.8.0 262
Windows OS : 2010
OpenWebStart version : 1.4.0
Any help/lead in this issue

Thanks in advance

You could run the agent from a batch file that is an endless loop, preferably with a sleep statement between each retry. How to create an infinite loop in Windows batch file? - Stack Overflow provides several different ways to create a batch file that loops forever.

Hey thanks for the reply , i tried to run the agent from agent.jar file but getting this warning in console and my agent is not going online

start java -jar C:\Jenkins\agent.jar

Output:- WARNING: Are you running slave agent from an interactive console?
If so, you are probably using it incorrectly.
See Jenkins : Launching slave.jar from from console

The Jenkins page for the agent (as in provides the full command line that needs to be used. The message you’re seeing usually means that one or more required arguments were not passed on the command line.

1 Like