1


I have a local server insalled on my system and have to start that from within my R function.

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

1
  • I've merged your two accounts together. Please read this Faq entry about cookie-based accounts. Also, StackOverflow isn't a forum; if you have a new question, please ask a new question. If you want to include more information in your question, please edit it. If you want to interact with one of the people who has answered, you can leave them a comment. Commented Apr 26, 2011 at 11:15

3 Answers 3

2

My problem is finally solved. I had to add Sys.sleep() and it runs after waiting for few seconds. Thank you for help.

Sign up to request clarification or add additional context in comments.

Comments

1

You need to determine whether or not the problem is with the server script or with R's execution of the script. Try:

  1. Running sh start-server.sh directly from a command prompt and seeing what happens.

  2. Running something simple via R's system function, e.g., system("ls", wait = FALSE).

Comments

1

By default, system waits for the executed command to terminate before returning. Add wait=FALSE if you want it to return immediately.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.