rpi3-webiopi icon indicating copy to clipboard operation
rpi3-webiopi copied to clipboard

Address already in use!! can't stop webiopi service

Open eirasys opened this issue 6 years ago • 1 comments

Hello! I'm trying to put webiopi working for E-Paper remote control and can't solve this problem, the service keeps running after trying to stop it. I can run several ones but with different addresses. Older software worked well with original webiopi, but in Jessie, now with recent Stretch OS it doesn't anymore.

Then when trying to restart with the same port address it says:

2019-02-16 21:00:44 - WebIOPi - ERROR - [Errno 98] Address already in use Traceback (most recent call last): File "/usr/lib/python3/dist-packages/webiopi/protocols/http.py", line 47, in init BaseHTTPServer.HTTPServer.init(self, ("", port), HTTPHandler) File "/usr/lib/python3.5/socketserver.py", line 440, in init self.server_bind() File "/usr/lib/python3.5/http/server.py", line 138, in server_bind socketserver.TCPServer.server_bind(self) File "/usr/lib/python3.5/socketserver.py", line 454, in server_bind self.socket.bind(self.server_address) OSError: [Errno 98] Address already in use

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/webiopi/main.py", line 75, in main(sys.argv) File "/usr/lib/python3/dist-packages/webiopi/main.py", line 69, in main server = Server(port=port, configfile=configfile, scriptfile=scriptfile) File "/usr/lib/python3/dist-packages/webiopi/server/init.py", line 123, in init self.http_server = http.HTTPServer(self.host, http_port, self.restHandler, context, docroot, index, auth, realm) File "/usr/lib/python3/dist-packages/webiopi/protocols/http.py", line 50, in init BaseHTTPServer.HTTPServer.init(self, ("", port), HTTPHandler) File "/usr/lib/python3.5/socketserver.py", line 440, in init self.server_bind() File "/usr/lib/python3.5/http/server.py", line 138, in server_bind socketserver.TCPServer.server_bind(self) File "/usr/lib/python3.5/socketserver.py", line 454, in server_bind self.socket.bind(self.server_address) OSError: [Errno 98] Address already in use

Any idea? Thanks a lot!

eirasys avatar Feb 16 '19 21:02 eirasys

Same here: #52

The process fails to stop. The included init.d service, being translated into a systemd forking service, does not really kill the main process, it stays active, stalling at 100% CPU usage even that the service appears to be stopped.

Using a native systemd unit will successfully SIGKILL it after 90 seconds timeout. But underlying problem can be much easier replicated by running python3 -m webiopi form console and trying to interrupt it via CTRL+C. It will hang the console until you SIGKILL it from elsewhere.

MichaIng avatar Apr 28 '21 12:04 MichaIng