MXS-1220: Allow binding to a specific address

The admin interface can now bind to a specific network interface.
This commit is contained in:
Markus Mäkelä
2017-05-02 06:05:15 +03:00
parent af2a4e792f
commit 4ed4773d91
5 changed files with 89 additions and 15 deletions

View File

@ -1982,6 +1982,18 @@ int main(int argc, char **argv)
}
}
if (mxs_admin_init())
{
MXS_NOTICE("Started REST API on [%s]:%u", cnf->admin_host, cnf->admin_port);
}
else
{
const char* logerr = "Failed to initialize admin interface";
print_log_n_stderr(true, true, logerr, logerr, 0);
rc = MAXSCALE_INTERNALERROR;
goto return_main;
}
MXS_NOTICE("MaxScale started with %d server threads.", config_threadcount());
/**
* Successful start, notify the parent process that it can exit.
@ -1992,14 +2004,6 @@ int main(int argc, char **argv)
write_child_exit_code(daemon_pipe[1], rc);
}
if (!mxs_admin_init())
{
const char* logerr = "Failed to initialize admin interface";
print_log_n_stderr(true, true, logerr, logerr, 0);
rc = MAXSCALE_INTERNALERROR;
goto return_main;
}
/*<
* Run worker 0 in the main thread.
*/