How can I shut down Rserve gracefully?

前端 未结 3 654
青春惊慌失措
青春惊慌失措 2020-12-28 18:56

I have tried many options both in Mac and in Ubuntu. I read the Rserve documentation

http://rforge.net/Rserve/doc.html

and that for the Rse

3条回答
  •  北海茫月
    2020-12-28 19:33

    On a Windows system, if you want to close an RServe instance, you can use the system function in R to close it down. For example in R:

    library(Rserve)
    Rserve() # run without any arguments or ports specified
    system('tasklist /FI "IMAGENAME eq Rserve.exe"') # run this to see RServe instances and their PIDs
    system('TASKKILL /PID {yourPID} /F') # run this to kill off the RServe instance with your selected PID
    

    If you have closed your RServe instance with that PID correctly, the following message will appear:

    SUCCESS: The process with PID xxxx has been terminated.

    You can check the RServe instance has been closed down by entering

    system('tasklist /FI "IMAGENAME eq Rserve.exe"')

    again. If there are no RServe instances running any more, you will get the message

    INFO: No tasks are running which match the specified criteria.

    More help and info on this topic can be seen in this related question.

    Note that the 'RSClient' approach mentioned in an earlier answer is tidier and easier than this one, but I put it forward anyway for those who start RServe without knowing how to stop it.

提交回复
热议问题