]> err.no Git - varnish/commitdiff
Added a new cli option, status, for checking the status of the varnish child process...
authorcecilihf <cecilihf@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 12 Jul 2007 10:20:33 +0000 (10:20 +0000)
committercecilihf <cecilihf@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 12 Jul 2007 10:20:33 +0000 (10:20 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1674 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/mgt_child.c
varnish-cache/bin/varnishd/mgt_cli.c
varnish-cache/bin/varnishd/mgt_cli.h
varnish-cache/bin/varnishd/varnishd.1
varnish-cache/include/cli.h

index e6f66abe39f7495b307aa63075a63b3022fcd1e7..71834c737f32b5131589fe42f9479b8c7daad0ad 100644 (file)
@@ -445,3 +445,13 @@ mcf_server_startstop(struct cli *cli, char **av, void *priv)
                cli_out(cli, "Child in state %s", ch_state[child_state]);
        }
 }
+
+/*--------------------------------------------------------------------*/
+
+void
+mcf_server_status(struct cli *cli, char **av, void *priv)
+{
+       (void)av;
+       (void)priv;
+       cli_out(cli, "Child is state %s", ch_state[child_state]);
+}
index d0a5b4af95b798b070d32b1d24a16b1a84ef2e0a..232bc2ee6b12af7a46e114d1f69e3758b0781ba0 100644 (file)
@@ -140,6 +140,7 @@ static struct cli_proto *cli_proto;
 /* XXX: what order should this list be in ? */
 static struct cli_proto mgt_cli_proto[] = {
        { CLI_PING,             cli_func_ping },
+       { CLI_SERVER_STATUS,    mcf_server_status, NULL },
        { CLI_SERVER_START,     mcf_server_startstop, NULL },
        { CLI_SERVER_STOP,      mcf_server_startstop, &cli_proto },
        { CLI_STATS,            mcf_stats, NULL },
index 884a776f7b4fe13d2658860be02ca13c08b68bdf..331598b1091326789fd5be003bc3fcaa8e4377f1 100644 (file)
@@ -31,6 +31,7 @@
 
 /* mgt_child.c */
 cli_func_t mcf_server_startstop;
+cli_func_t mcf_server_status;
 
 /* mgt_param.c */
 cli_func_t mcf_param_show;
index e7d3eb86c08cc32015589c9d746f3935e83eaa41..ad226e27f7ff3ffa21d3550e54b2e00ccc724526 100644 (file)
@@ -316,6 +316,8 @@ All the numbers presented are totals since server startup; for a
 better idea of the current situation, use the
 .Xr varnishstat 1
 utility.
+.It Cm status
+Check the status of the child process.
 .It Cm stop
 Stop the child process.
 .It Cm url.purge Ar regexp
index 11013ec8a2b21ed61da3eb8a250ca790c43fe9dd..2852b208a0c9d8019c6c40d5097f48478b8c8f00 100644 (file)
        "\tClose connection",                                           \
        0, 0
 
+# define CLI_SERVER_STATUS                                             \
+       "status",                                                       \
+       "status",                                                       \
+       "\tCheck status of Varnish cache process.",                     \
+       0, 0
+
 /*
  * Status/return codes in the CLI protocol
  */