Add destruction of listeners

The listeners aren't really destroyed and are only stopped. Further
changes are required so that they won't be started again once they have
been destroyed.
This commit is contained in:
Markus Makela
2016-11-25 14:48:11 +02:00
parent 6ea4e50f2c
commit 88677946f8
5 changed files with 85 additions and 5 deletions

View File

@ -1111,6 +1111,18 @@ static void destroyServer(DCB *dcb, SERVER *server)
}
}
static void destroyListener(DCB *dcb, SERVICE *service, const char *name)
{
if (runtime_destroy_listener(service, name))
{
dcb_printf(dcb, "Destroyed listener '%s'\n", name);
}
else
{
dcb_printf(dcb, "Failed to destroy listener '%s', see log file for more details\n", name);
}
}
struct subcommand destroyoptions[] =
{
{
@ -1119,6 +1131,12 @@ struct subcommand destroyoptions[] =
"Usage: destroy server NAME",
{ARG_TYPE_SERVER}
},
{
"listener", 2, 2, destroyListener,
"Destroy a listener",
"Usage: destroy listener SERVICE NAME",
{ARG_TYPE_SERVICE, ARG_TYPE_STRING}
},
{
EMPTY_OPTION
}