MXS-1929: Allow startup with no services

MaxScale can now be started with an empty configuration file and services
can be created at runtime. Filters cannot yet be created at runtime so
complete runtime creation of configurations is not yet possible.
This commit is contained in:
Markus Mäkelä
2018-07-23 13:48:19 +03:00
parent 106b1d46d5
commit a50fce0c65
3 changed files with 4 additions and 3 deletions

View File

@ -2094,7 +2094,7 @@ int main(int argc, char **argv)
/** Start the services that were created above */
n_services = service_launch_all();
if (n_services == 0)
if (n_services == -1)
{
const char* logerr = "Failed to start all MaxScale services. Exiting.";
print_log_n_stderr(true, true, logerr, logerr, 0);

View File

@ -87,7 +87,7 @@ void service_destroy_instances(void);
* Initialize and start all services. This should only be called once by the
* main initialization code.
*
* @return Number of successfully started services
* @return Number of successfully started services or -1 on error
*/
int service_launch_all(void);

View File

@ -650,7 +650,8 @@ int service_launch_all()
ptr = ptr->next;
}
return error ? 0 : n;
return error ? -1 : n;
}
bool serviceStop(SERVICE *service)