Press "Enter" to skip to content

How to “clear” a used port in a Linux system using a Django application.

Hi,

If you face an error: “Error: That port is already in use.” you can solve it following these steps.

This solution has been tested in a Cuckoo sandbox 2.0.4 environment on an Ubuntu 17.04 box.

(venv) ruben@wonderland:~$ cuckoo web -H 0
Performing system checks...
System check identified no issues (0 silenced).
September 12, 2017 - 19:27:30
Django version 1.8.4, using settings 'cuckoo.web.web.settings'
Starting development server at http://0:8000/
Quit the server with CONTROL-C.
Error: That port is already in use.

(venv) ruben@wonderland:~$ ps aux | grep cuckoo
ruben 15000 2.7 1.1 490180 145040 pts/1 Sl 19:18 0:30 /home/ruben/venv/bin/python2 /home/ruben/venv/bin/cuckoo web -H 0
ruben 15322 3.7 1.2 502440 156596 pts/0 Sl+ 19:22 0:33 /home/ruben/venv/bin/python2 /home/ruben/venv/bin/cuckoo -d
ruben 15885 0.0 0.0 15460 944 pts/1 S+ 19:37 0:00 grep —color=auto cuckoo

(venv) ruben@wonderland:~$ kill 15000
(venv) ruben@wonderland:~$ ps aux | grep cuckoo
ruben 15322 3.7 1.2 502440 156596 pts/0 Sl+ 19:22 0:34 /home/ruben/venv/bin/python2 /home/ruben/venv/bin/cuckoo -d
ruben 15891 0.0 0.0 15460 1016 pts/1 S+ 19:38 0:00 grep —color=auto cuckoo

(venv) ruben@wonderland:~$ cuckoo web -H 0
Performing system checks...
System check identified no issues (0 silenced).
September 12, 2017 - 19:38:20
Django version 1.8.4, using settings 'cuckoo.web.web.settings'
Starting development server at http://0:8000/
Quit the server with CONTROL-C.

Regards,
Rubén.

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *