here is how I start it:
cmd<-"sh start-server.sh"
system(cmd, wait=FALSE)
I have to perform computations after starting the server. Basically my function has to start the ser开发者_高级运维ver and proceeds with further steps. The server starts but the further steps of the program are not executed.The cursor keeps waiting after the server is started.
Please suggest how to go about this.
My problem is finally solved. I had to add Sys.sleep() and it runs after waiting for few seconds. Thank you for help.
You need to determine whether or not the problem is with the server script or with R's execution of the script. Try:
Running
sh start-server.sh
directly from a command prompt and seeing what happens.Running something simple via R's
system
function, e.g.,system("ls", wait = FALSE)
.
By default, system
waits for the executed command to terminate before returning. Add wait=FALSE
if you want it to return immediately.
精彩评论