HTTP server could not start if no network interface available

Issue #537 resolved
Former user created an issue

I have a strange behavior using 5.19.0 version of monit on a Linux isolated equipment: the HTTP interface is not available if only the loopback interface is available.

Using the same binary and configuration file and adding an interface (here eth0), the socket is correctly created on the loopback interface (as shown in netstat.log).

I have tested using a previous version of monit (5.18.0) and the problem was not present.

Comments (7)

  1. Former user Account Deleted reporter

    Seems to be link with the flag AI_ADDRCONFIG in hints for getaddrinfo calls. I tried to remove it and it works better.

  2. Patrick Oberdorfer

    I can confirm this bug, if interfaces are down monit httpd wont start even when listening on 0.0.0.0 which should be possible by recent kernels. Why is the use of AI_ADDRCONFIG in monit? Any benefits from using this non default flag? If there are non can this be removed? I think a lot of startup problems are related to this.

    This also affects 5.20.0

  3. Tildeslash repo owner

    Thanks for bringing this to our attention. Removed usage of AI_ADDRCONFIG with this checkin dcc28e7ffaed. Could you guys be so kind and checkout Monit from Git and test and let us know if this solves the problem you have?

  4. Former user Account Deleted reporter

    Using the same situation with a v5.19.0 and the version from the commit 4198fddf251f, I confirm that the problem is not present using your correction. Seems good for me! Thanks!

  5. Rahul De

    Hi,

    When will be an stable release be available having this fix? We are planning to deploy onto production soon and were hoping we don't have to compile from source for this bug.

    Thanks!

  6. Log in to comment