Commit 06bd22ca authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Add two hidden CLI commands for panic'ing the master and worker process.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@3767 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 8c8e60fe
...@@ -223,6 +223,18 @@ ccf_help(struct cli *cli, const char * const *av, void *priv) ...@@ -223,6 +223,18 @@ ccf_help(struct cli *cli, const char * const *av, void *priv)
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
static void
ccf_panic(struct cli *cli, const char * const *av, void *priv)
{
(void)cli;
(void)av;
(void)priv;
assert(!strcmp("", "You asked for it"));
}
/*--------------------------------------------------------------------*/
static struct cli_proto master_cmds[] = { static struct cli_proto master_cmds[] = {
{ CLI_PING, cli_func_ping }, { CLI_PING, cli_func_ping },
{ CLI_HELP, ccf_help, NULL }, { CLI_HELP, ccf_help, NULL },
...@@ -233,6 +245,9 @@ static struct cli_proto debug_cmds[] = { ...@@ -233,6 +245,9 @@ static struct cli_proto debug_cmds[] = {
{ "debug.sizeof", "debug.sizeof", { "debug.sizeof", "debug.sizeof",
"\tDump sizeof various data structures\n", "\tDump sizeof various data structures\n",
0, 0, cli_debug_sizeof }, 0, 0, cli_debug_sizeof },
{ "debug.panic.worker", "debug.panic.worker",
"\tPanic the worker process.\n",
0, 0, ccf_panic },
{ NULL } { NULL }
}; };
......
...@@ -161,11 +161,26 @@ static struct cli_proto cli_proto[] = { ...@@ -161,11 +161,26 @@ static struct cli_proto cli_proto[] = {
{ CLI_PARAM_SET, mcf_param_set, NULL }, { CLI_PARAM_SET, mcf_param_set, NULL },
{ CLI_QUIT, mcf_close, NULL}, { CLI_QUIT, mcf_close, NULL},
#if 0 { NULL }
{ CLI_SERVER_RESTART }, };
{ CLI_ZERO },
{ CLI_VERBOSE, m_cli_func_verbose, NULL }, /*--------------------------------------------------------------------*/
#endif
static void
mcf_panic(struct cli *cli, const char * const *av, void *priv)
{
(void)cli;
(void)av;
(void)priv;
assert(!strcmp("", "You asked for it"));
}
static struct cli_proto cli_debug[] = {
{ "debug.panic.master", "debug.panic.master",
"\tPanic the master process.\n",
0, 0, mcf_panic, NULL},
{ NULL } { NULL }
}; };
...@@ -267,6 +282,8 @@ mgt_cli_vlu(void *priv, const char *p) ...@@ -267,6 +282,8 @@ mgt_cli_vlu(void *priv, const char *p)
return (0); return (0);
cli_dispatch(cp->cli, cli_proto, p); cli_dispatch(cp->cli, cli_proto, p);
if (cp->cli->result == CLIS_UNKNOWN)
cli_dispatch(cp->cli, cli_debug, p);
if (cp->cli->result == CLIS_UNKNOWN) { if (cp->cli->result == CLIS_UNKNOWN) {
/* /*
* Command not recognized in master, try cacher if it is * Command not recognized in master, try cacher if it is
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment