I am trying to use exec to start a process on a remote windows machine. I am using the psexec tool from sysinternals.com. The first call which reads the JAVA_HOME environment variable from the remote machine is working. The problem is that the call to ping is never returning. When I execute the same command from the commandline outside of gradle it works without problems.
Any ideas? I am using gradle 1.3 How does the exec task determine when a process has finished?
Sorry i dont understand what i am supposed to try.
i am using psexec.exe to call the command “cmd /c ping localhost” on a remote machine. the first few lines of the ping output are shown on the console but then there is no more progress and exec/gradle does not return.
if i run gradle in info mode and copy out the used command and run it standalone in a local console it works without problems (and shows the output of the ping command of the remote server).
do you want me to start the psexec on my local machine also with a “cmd /c” in the front? i tried that, the problem was the same, see here:
Starting process 'command 'cmd''. Working directory: C:\_gradle Command: cmd /c C:/tools/sys/PsExec.exe \yourserver -user localhost\Administrator -p yourpw cmd /
c ping localhost && exit
Successfully started process 'command 'cmd''
PsExec v1.98 - Execute processes remotely
Copyright (C) 2001-2010 Mark Russinovich
Sysinternals - www.sysinternals.com
Ping wird ausgef?hrt f?r yourserver [::1]
> Building > :callping
Not really. It would be good to know if you can get it to work with a plain Java or Groovy command-line app that uses ‘java.lang.ProcessBuilder’ to call ‘psexec’. Also make sure to try with ‘–no-daemon’.
I tried with the “–no-daemon” parameter, still the same problem.
If i have more time i might try with the processbuilder.
But isnt it strange that the first call to the echo command on the remote machine works without problems? I tried to have the ping call being the only exec task, still the same problem.