Fix to MXS-438: https://mariadb.atlassian.net/browse/MXS-438
Maxinfo now supports the shutdown command which shuts down a service, monitor or MaxScale itself and the restart command which restarts a stopped monitor or service.
This commit is contained in:
@ -1092,40 +1092,6 @@ restart_service(DCB *dcb, SERVICE *service)
|
||||
serviceRestart(service);
|
||||
}
|
||||
|
||||
static struct {
|
||||
char *str;
|
||||
unsigned int bit;
|
||||
} ServerBits[] = {
|
||||
{ "running", SERVER_RUNNING },
|
||||
{ "master", SERVER_MASTER },
|
||||
{ "slave", SERVER_SLAVE },
|
||||
{ "synced", SERVER_JOINED },
|
||||
{ "ndb", SERVER_NDB },
|
||||
{ "maintenance", SERVER_MAINT },
|
||||
{ "maint", SERVER_MAINT },
|
||||
{ NULL, 0 }
|
||||
};
|
||||
/**
|
||||
* Map the server status bit
|
||||
*
|
||||
* @param str String representation
|
||||
* @return bit value or 0 on error
|
||||
*/
|
||||
static unsigned int
|
||||
server_map_status(char *str)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; ServerBits[i].str; i++)
|
||||
{
|
||||
if (!strcasecmp(str, ServerBits[i].str))
|
||||
{
|
||||
return ServerBits[i].bit;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the status bit of a server
|
||||
*
|
||||
|
Reference in New Issue
Block a user