| Hi Ivan Fernandez Calvo, I see you have marked this bug as Resolved; however, I wouldn't consider it resolved myself because I am still running into issues with the JAR cache not being in the remoting work directory. I am running Jenkins 1.38 and ssh-slaves 1.28.1. My slave has a custom remote root directory set to /var/tmp/jenkins_slaves/developer/jenkins-ops.basil. I have not customized the default blank values of "Prefix Start Agent Command", "Suffix Start Agent Command", or "Remoting Work directory". The SSH Slaves plugin launched the agent with these arguments:
$ ps aux | grep 16636
testrun+ 16636 4.9 0.7 8935864 141940 ? Sl 15:56 0:10 java -jar remoting.jar -workDir /var/tmp/jenkins_slaves/developer/jenkins-ops.basil
$ ls -la /proc/16636/cwd
lrwxrwxrwx 1 testrunner testrunner 0 Sep 6 16:00 /proc/16636/cwd -> /var/tmp/jenkins_slaves/developer/jenkins-ops.basil
$
So far, so good. However, the JAR cache in the remoting work directory is unused:
$ sudo lsof +D /var/tmp/jenkins_slaves/developer/jenkins-ops.basil/remoting/jarCache
$
Instead, the JARs are in the user's home directory:
$ ls -la /proc/16636/fd | grep jar$
lr-x------ 1 testrunner testrunner 64 Sep 6 15:56 27 -> /home/testrunner/.jenkins/cache/jars/45/7D1F280AA7032BF63A03A6373A4567.jar
lr-x------ 1 testrunner testrunner 64 Sep 6 15:56 28 -> /home/testrunner/.jenkins/cache/jars/37/E5427196D65650CF3C42C210055645.jar
lr-x------ 1 testrunner testrunner 64 Sep 6 15:56 30 -> /home/testrunner/.jenkins/cache/jars/F2/84FCC8C54FBFD68EF9E319A863DC13.jar
lr-x------ 1 testrunner testrunner 64 Sep 6 15:56 31 -> /home/testrunner/.jenkins/cache/jars/68/275882C8D31CAC88CDDAFAD86DA00E.jar
lr-x------ 1 testrunner testrunner 64 Sep 6 15:56 32 -> /home/testrunner/.jenkins/cache/jars/52/2E6E3E1C7BC42C922CB96F9827053E.jar
lr-x------ 1 testrunner testrunner 64 Sep 6 15:56 33 -> /home/testrunner/.jenkins/cache/jars/9D/A971C5B4DEE22798C5DE5187375513.jar
lr-x------ 1 testrunner testrunner 64 Sep 6 15:56 34 -> /home/testrunner/.jenkins/cache/jars/9E/2AF9045A0E0FBF520FE664585A9E4F.jar
lr-x------ 1 testrunner testrunner 64 Sep 6 15:56 35 -> /home/testrunner/.jenkins/cache/jars/10/D6706954D98E54D3BBC6FC9632E8C8.jar
lr-x------ 1 testrunner testrunner 64 Sep 6 15:56 36 -> /home/testrunner/.jenkins/cache/jars/1F/010F383654E1F95625595B64691EA1.jar
lr-x------ 1 testrunner testrunner 64 Sep 6 15:56 37 -> /home/testrunner/.jenkins/cache/jars/E2/DB61AFEAF868ABF5814EADCE114406.jar
lr-x------ 1 testrunner testrunner 64 Sep 6 15:56 38 -> /home/testrunner/.jenkins/cache/jars/DB/8A4DF2E81A8CAD5CE8FFDC86EB96D0.jar
lr-x------ 1 testrunner testrunner 64 Sep 6 15:56 39 -> /home/testrunner/.jenkins/cache/jars/F3/D242560AF5B707558485E723CB0CCF.jar
lr-x------ 1 testrunner testrunner 64 Sep 6 15:56 40 -> /home/testrunner/.jenkins/cache/jars/80/A8CA5D38908CA3ACA438F7395BFCC4.jar
lr-x------ 1 testrunner testrunner 64 Sep 6 15:56 41 -> /home/testrunner/.jenkins/cache/jars/19/D84AFBF2DB88C3862487B83051DB9B.jar
lr-x------ 1 testrunner testrunner 64 Sep 6 15:56 42 -> /home/testrunner/.jenkins/cache/jars/E3/8E9F4A8B3127DE325345EAF90DFA04.jar
lr-x------ 1 testrunner testrunner 64 Sep 6 15:56 43 -> /home/testrunner/.jenkins/cache/jars/D8/43212FAB3EE2939EBC386D926B205B.jar
lr-x------ 1 testrunner testrunner 64 Sep 6 15:56 44 -> /home/testrunner/.jenkins/cache/jars/A3/45F6FD31301426ACC6BCE98E42C87A.jar
lr-x------ 1 testrunner testrunner 64 Sep 6 15:56 45 -> /home/testrunner/.jenkins/cache/jars/28/BD24AE31D699682C04D2017BE4037C.jar
lr-x------ 1 testrunner testrunner 64 Sep 6 15:56 46 -> /home/testrunner/.jenkins/cache/jars/21/06F1EF0FB710683187C98FE4AA61C3.jar
This is not what is expected given the remoting work directory documentation. The latter states that the JARs should be in the /var/tmp/jenkins_slaves/developer/jenkins-ops.basil/remoting/jarCache directory. And Oleg Nenashev has confirmed my interpretation above. So clearly something is still not working correctly. As a workaround, I adjusted the "Suffix Start Agent Command" to read {{ -jar-cache /var/tmp/jenkins_slaves/developer/jenkins-ops.basil/jarCache}}. And this has worked around the issue and my JARs are now going in the right place. But this should just work by default. |