Mailing List Archive

r1674 - in trunk/varnish-cache: bin/varnishd include
Author: cecilihf
Date: 2007-07-12 12:20:33 +0200 (Thu, 12 Jul 2007)
New Revision: 1674

Modified:
trunk/varnish-cache/bin/varnishd/mgt_child.c
trunk/varnish-cache/bin/varnishd/mgt_cli.c
trunk/varnish-cache/bin/varnishd/mgt_cli.h
trunk/varnish-cache/bin/varnishd/varnishd.1
trunk/varnish-cache/include/cli.h
Log:
Added a new cli option, status, for checking the status of the varnish child process. This is for use in the webmin plugin.


Modified: trunk/varnish-cache/bin/varnishd/mgt_child.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt_child.c 2007-07-12 10:13:29 UTC (rev 1673)
+++ trunk/varnish-cache/bin/varnishd/mgt_child.c 2007-07-12 10:20:33 UTC (rev 1674)
@@ -445,3 +445,13 @@
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]);
+}

Modified: trunk/varnish-cache/bin/varnishd/mgt_cli.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt_cli.c 2007-07-12 10:13:29 UTC (rev 1673)
+++ trunk/varnish-cache/bin/varnishd/mgt_cli.c 2007-07-12 10:20:33 UTC (rev 1674)
@@ -140,6 +140,7 @@
/* 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 },

Modified: trunk/varnish-cache/bin/varnishd/mgt_cli.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt_cli.h 2007-07-12 10:13:29 UTC (rev 1673)
+++ trunk/varnish-cache/bin/varnishd/mgt_cli.h 2007-07-12 10:20:33 UTC (rev 1674)
@@ -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;

Modified: trunk/varnish-cache/bin/varnishd/varnishd.1
===================================================================
--- trunk/varnish-cache/bin/varnishd/varnishd.1 2007-07-12 10:13:29 UTC (rev 1673)
+++ trunk/varnish-cache/bin/varnishd/varnishd.1 2007-07-12 10:20:33 UTC (rev 1674)
@@ -316,6 +316,8 @@
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

Modified: trunk/varnish-cache/include/cli.h
===================================================================
--- trunk/varnish-cache/include/cli.h 2007-07-12 10:13:29 UTC (rev 1673)
+++ trunk/varnish-cache/include/cli.h 2007-07-12 10:20:33 UTC (rev 1674)
@@ -211,6 +211,12 @@
"\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
*/