pygmystack / pygmy

the pygmy stack is a container stack for local development
MIT License
25 stars 13 forks source link

Linux doesn't want to occupy port `80`, false reports of port in use? #79

Closed fubarhouse closed 4 years ago

tobybellwood commented 4 years ago
ubuntu@primary:~/pygmy-go$ pygmy-go status
[*] amazeeio-dnsmasq is able to start on port 6053
[ ] amazeeio-haproxy is not able to start on port 80: already in use
[*] mailhog.docker.amazee.io is able to start on port 1025

[ ] amazeeio-dnsmasq is not running
[ ] amazeeio-haproxy is not running
[ ] mailhog.docker.amazee.io is not running
[ ] amazeeio-ssh-agent is not running
[ ] amazeeio-network network has not been created
[ ] Resolv Linux Resolver is not properly connected
Error response from daemon: No such container: amazeeio-ssh-agent
 - http://docker.amazee.io/stats (amazeeio-haproxy)
 - http://mailhog.docker.amazee.io (mailhog.docker.amazee.io)
ubuntu@primary:~/pygmy-go$ nmap -p 80 localhost

Starting Nmap 7.60 ( https://nmap.org ) at 2019-12-23 17:39 AEDT
Nmap scan report for localhost (127.0.0.1)
Host is up (0.00035s latency).

PORT   STATE  SERVICE
80/tcp closed http

Nmap done: 1 IP address (1 host up) scanned in 0.06 seconds
ubuntu@primary:~/pygmy-go$ lsof -i :80
ubuntu@primary:~/pygmy-go$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.3 LTS
Release:    18.04
Codename:   bionic
tobybellwood commented 4 years ago

possibly limited to Ubuntu - observed on Ubuntu 18.04 (Ubuntu and Mint 19.02 variants) and 19.10

tobybellwood commented 4 years ago

right - the dryrun checks throw an error with listen tcp :80: bind: permission denied - which causes it to think it's occupied (and not that it can't bind to it because <1024 on Linux)

fubarhouse commented 4 years ago

Thanks for the diagnosis!

This may be a little harder to solve, I may need to rewrite it specifically for linux... without the use of sudo how would you suggest to do port usage detection?

fubarhouse commented 4 years ago

Testing is now passing on issue/79 in PR #80. Please provide feedback if you're able.