]> err.no Git - varnish/commitdiff
Add two hidden CLI commands for panic'ing the master and worker process.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 13 Feb 2009 12:16:34 +0000 (12:16 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 13 Feb 2009 12:16:34 +0000 (12:16 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3767 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_cli.c
varnish-cache/bin/varnishd/mgt_cli.c

index 648ebd8acef95e63a61ff1759932da3ff72ed464..1d0a5cb71b1b8825086c0cdd38c17a1cec91b057 100644 (file)
@@ -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[] = {
        { CLI_PING,             cli_func_ping },
        { CLI_HELP,             ccf_help, NULL },
@@ -233,6 +245,9 @@ static struct cli_proto debug_cmds[] = {
        { "debug.sizeof", "debug.sizeof",
                "\tDump sizeof various data structures\n",
                0, 0, cli_debug_sizeof },
+       { "debug.panic.worker", "debug.panic.worker",
+               "\tPanic the worker process.\n",
+               0, 0, ccf_panic },
        { NULL }
 };
 
index 15a3ce0e8d17d2869ed4284d0830bf43bb865ded..040d2a185a978fdce39df57685979df2db882f55 100644 (file)
@@ -161,11 +161,26 @@ static struct cli_proto cli_proto[] = {
        { CLI_PARAM_SET,        mcf_param_set, NULL },
 
        { CLI_QUIT,             mcf_close, NULL},
-#if 0
-       { CLI_SERVER_RESTART },
-       { CLI_ZERO },
-       { CLI_VERBOSE,          m_cli_func_verbose, NULL },
-#endif
+       { NULL }
+};
+
+/*--------------------------------------------------------------------*/
+
+
+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 }
 };
 
@@ -267,6 +282,8 @@ mgt_cli_vlu(void *priv, const char *p)
                return (0);
 
        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) {
                /*
                 * Command not recognized in master, try cacher if it is