MXS-2196: Don't start if listeners fail to start

The old behavior is to not start MaxScale if any listeners fail to
bind. This behavior is convenient when there are conflicts with other
applications so it should remain. This change prevents the internal
service restarts from functioning which might have already been broken.

The "restarting" of services after a failure to bind to an interface is
somewhat questionable. Almost no transient errors are expected at startup
with the exception of running out of sockets. This should probably be the
only case when the internal service restart is done and in other cases it
causes more harm than good.
This commit is contained in:
Markus Mäkelä 2018-12-27 15:09:41 +02:00
parent 6206abde3e
commit 459eb003de
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19
2 changed files with 5 additions and 1 deletions

View File

@ -988,7 +988,7 @@ bool Listener::listen()
case MXS_AUTH_LOADUSERS_FATAL:
MXS_ERROR("[%s] Fatal error when loading users for listener '%s', "
"service is not started.", m_service->name, name());
return 0;
return false;
case MXS_AUTH_LOADUSERS_ERROR:
MXS_WARNING("[%s] Failed to load users for listener '%s', authentication"

View File

@ -338,6 +338,10 @@ int serviceStartAllPorts(Service* service)
{
++listeners;
}
else
{
return 0;
}
}
if (service->state == SERVICE_STATE_FAILED)