osx - python SimpleHTTPServer suspended, how to stop? -
i accidentally hit ctrl z instead of ctrl c stop python simplehttpserver , came saying
[1] + 35296 suspended python -m simplehttpserver
now cannot restart on same port port 8000 in use
traceback (most recent call last): file "/system/library/frameworks/python.framework/versions/2.7/lib/python2.7/runpy.py", line 162, in _run_module_as_main "__main__", fname, loader, pkg_name) file "/system/library/frameworks/python.framework/versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals file "/system/library/frameworks/python.framework/versions/2.7/lib/python2.7/simplehttpserver.py", line 220, in <module> test() file "/system/library/frameworks/python.framework/versions/2.7/lib/python2.7/simplehttpserver.py", line 216, in test basehttpserver.test(handlerclass, serverclass) file "/system/library/frameworks/python.framework/versions/2.7/lib/python2.7/basehttpserver.py", line 595, in test httpd = serverclass(server_address, handlerclass) file "/system/library/frameworks/python.framework/versions/2.7/lib/python2.7/socketserver.py", line 419, in __init__ self.server_bind() file "/system/library/frameworks/python.framework/versions/2.7/lib/python2.7/basehttpserver.py", line 108, in server_bind socketserver.tcpserver.server_bind(self) file "/system/library/frameworks/python.framework/versions/2.7/lib/python2.7/socketserver.py", line 430, in server_bind self.socket.bind(self.server_address) file "/system/library/frameworks/python.framework/versions/2.7/lib/python2.7/socket.py", line 224, in meth return getattr(self._sock,name)(*args) socket.error: [errno 48] address in use
how can stop process can use port 8000 again?
thanks
the process suspended in background, you'll have kill release port.
if you're in same terminal, running fg
bring front , reactivate it, letting interrupt ctrl+c.
if you're not, can use number got printed (the process id, or pid) kill it, you'll first have reactivate it, can react:
kill -cont 35296 kill 35296
Comments
Post a Comment