tkluck / pac4cli

Proxy-auto-discovery for command-line applications
25 stars 9 forks source link

Systemd after networkmanager #49

Closed tkluck closed 6 years ago

tkluck commented 6 years ago

This is a few changes that seemed to make sense to me when I dug deeper into the startup process for #47 and #48. The changes are not needed to fix those issues but seem to make the process better overall.

Specifically:

This pull request makes these improvements.

tkluck commented 6 years ago

@kdehairy the CI failure seems related to #45 :

INFO [4890]: pac4cli: Starting proxy server on localhost:23129
INFO [4890]: pac4cli: resolving interface: localhost
INFO [4890]: pac4cli: localhost => 127.0.0.1
INFO [4890]: pac4cli: localhost => 127.0.0.1
INFO [4890]: pac4cli: localhost => 0000:0000:0000:0000:0000:0000:0000:0001
['127.0.0.1', '127.0.0.1', '0000:0000:0000:0000:0000:0000:0000:0001']
INFO [4890]: pac4cli: Binding to interface: '127.0.0.1'
INFO [4890]: pac4cli: Binding to interface: '127.0.0.1'
ERROR [4890]: pac4cli: Problem starting the server
<snip>
OSError: [Errno 98] Address already in use

Thoughts?

kdehairy commented 6 years ago

Weird! This will happen if the localhost is mapped to 127.0.0.1 multiple times in the /etc/hosts (in this case twice). I also checked this and reproduced it on my local machine by editing my /etc/hosts.

But anyways we should be resilient to this. I'll check for duplicates and remove them after resolving the domain name.