문제

I want to restart classic_server of RPyC in Linux through remote console
but I do not know how to restart it.

so I create a bash to kill all python process,
and then restart classic_server
but when I'm call it in remote console through subprocess , it says addr is already in use.

debug shows that before I killed python, python is listening on 18812, which is port classic_server listening to ,
but after bash script killed it, bash script took the place of classic_server to listen to port 18812 ! Very strange , yeah?

So I ask for a method to restart classic server , or how to solve the probem

도움이 되었습니까?

해결책

I am running the Sevice module, not the classic module, but when creating the server instance, you can set the port number - this should avoid port overload.

server = ThreadedServer(AgentService, port = 12345)

As for the bash script, it might be worth writing a service and adding it to init.d. eg: http://www.unix.com/unix-dummies-questions-answers/34641-making-script-start-service.html

this wont solve the problem but it will definately make the server easier to work with.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top