How to close rserve from the command line

this issue is connected closely and perhaps close Rserve to this. However, in a later case, connections are open, and in the first case, the answer does not indicate how to "kill" the server.

It's important to say that I'm new to Rserve, and I used it for the first time today for some soft R-python interaction. I started rserve from the command line like:

% R CMD RServe 

I, although I closed the connection after the session, but when I try to start Rserve again with the new configuration, I get an error:

 % ##> SOCK_ERROR: bind error #48(address already in use) 

which is pretty clear. Moreover, ps ax | grep Rserve ps ax | grep Rserve returns:

 % ps ax | grep Rserve 18177 ?? Ss 0:00.33 /Library/Frameworks/R.framework/Resources/bin/Rserve 18634 s006 U+ 0:00.00 grep Rserve 

which, as I understand it, really means that the server is working. I have tried several things:

 % R CMD RSclose /Library/Frameworks/R.framework/Resources/bin/Rcmd: line 62: exec: RSclose: not found % R CMD RSshutdown /Library/Frameworks/R.framework/Resources/bin/Rcmd: line 62: exec: RSshutdown: not found 

and finally

 % R CMD shutdown shutdown: NOT super-user 

I am wondering if I should run:

 % sudo R CMD shutdown 

(I would like to make sure before running this command if I fasten something)

In any case, the question will be very simple. How to close the server to restart.

Thank you in advance for your time!

+6
source share
1 answer

Are you confused:

  R CMD something 

will always refer to R. And R no longer knows that Rserve works, even if you may have started it through R CMD Rserve : now these are different processes.

What you have to do is

  kill 18177 # or possibly kill -9 18177 

and there are wrappers for kill that first grep for the name and find the PID for you:

  killall Rserve # or possibly killall -9 Rserve 

-9 sends a higher level of SIGKILL (i.e., "really go and die now") than the default value of -15 for SIGTERM ) (i.e., "please stop now").

+8
source

Source: https://habr.com/ru/post/986571/


All Articles