svn commit: r251025 - in stable/9: . sbin/hastctl

Dmitry Morozovsky marck at FreeBSD.org
Mon May 27 13:49:56 UTC 2013


Author: marck (doc committer)
Date: Mon May 27 13:49:55 2013
New Revision: 251025
URL: http://svnweb.freebsd.org/changeset/base/251025

Log:
  Preparation for MFC revs r248291 and r249741:
  
  Add 'list' command, for now the exact equivalent of 'status',
  so users of the latter could change their scripts.
  
  This is direct commit to stable, and is temporary.
  
  Requested by:	Pete French <petefrench at ingresso.co.uk>
  Approved by:	trociny
  2B cleaned after:	6 weeks

Modified:
  stable/9/UPDATING
  stable/9/sbin/hastctl/hastctl.8
  stable/9/sbin/hastctl/hastctl.c

Modified: stable/9/UPDATING
==============================================================================
--- stable/9/UPDATING	Mon May 27 08:50:10 2013	(r251024)
+++ stable/9/UPDATING	Mon May 27 13:49:55 2013	(r251025)
@@ -11,6 +11,13 @@ handbook:
 Items affecting the ports and packages system can be found in
 /usr/ports/UPDATING.  Please read that file before running portupgrade.
 
+20130524:
+	`list' command has been added to hastctl(8).  For now, it is full
+	equivalent of `status' command.
+	WARNING: in the near future the output of hastctl's status command
+	will change to more terse format.  If you use `hastctl status'
+	for parsing in your scripts, switch to `hastctl list'.
+
 20130430:
 	The mergemaster command now uses the default MAKEOBJDIRPREFIX
 	rather than creating it's own in the temporary directory in

Modified: stable/9/sbin/hastctl/hastctl.8
==============================================================================
--- stable/9/sbin/hastctl/hastctl.8	Mon May 27 08:50:10 2013	(r251024)
+++ stable/9/sbin/hastctl/hastctl.8	Mon May 27 13:49:55 2013	(r251025)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 10, 2011
+.Dd May 24, 2013
 .Dt HASTCTL 8
 .Os
 .Sh NAME
@@ -49,6 +49,11 @@
 .Aq init | primary | secondary
 .Ar all | name ...
 .Nm
+.Cm list
+.Op Fl d
+.Op Fl c Ar config
+.Op Ar all | name ...
+.Nm
 .Cm status
 .Op Fl d
 .Op Fl c Ar config
@@ -139,8 +144,19 @@ GEOM provider
 .Pa /dev/hast/<name>
 will not be created on secondary node.
 .El
+.It Cm list
 .It Cm status
-Present status of the configured resources.
+Present verbose status of the configured resources.
+For now, list and status commands are equivalent.
+In the near future the output of 
+.Nm
+status command will change to more terse format.
+If you use `
+.Nm
+status' for parsing in your scripts, switch to `
+.Nm
+list'.
+
 .It Cm dump
 Dump metadata stored on local component for the configured resources.
 .El

Modified: stable/9/sbin/hastctl/hastctl.c
==============================================================================
--- stable/9/sbin/hastctl/hastctl.c	Mon May 27 08:50:10 2013	(r251024)
+++ stable/9/sbin/hastctl/hastctl.c	Mon May 27 13:49:55 2013	(r251025)
@@ -70,7 +70,8 @@ enum {
 	CMD_CREATE,
 	CMD_ROLE,
 	CMD_STATUS,
-	CMD_DUMP
+	CMD_DUMP,
+	CMD_LIST
 };
 
 static __dead2 void
@@ -85,6 +86,9 @@ usage(void)
 	    "       %s role [-d] [-c config] <init | primary | secondary> all | name ...\n",
 	    getprogname());
 	fprintf(stderr,
+	    "       %s list [-d] [-c config] [all | name ...]\n",
+	    getprogname());
+	fprintf(stderr,
 	    "       %s status [-d] [-c config] [all | name ...]\n",
 	    getprogname());
 	fprintf(stderr,
@@ -381,6 +385,9 @@ main(int argc, char *argv[])
 	} else if (strcmp(argv[1], "role") == 0) {
 		cmd = CMD_ROLE;
 		optstr = "c:dh";
+	} else if (strcmp(argv[1], "list") == 0) {
+		cmd = CMD_LIST;
+		optstr = "c:dh";
 	} else if (strcmp(argv[1], "status") == 0) {
 		cmd = CMD_STATUS;
 		optstr = "c:dh";
@@ -469,6 +476,7 @@ main(int argc, char *argv[])
 		for (ii = 0; ii < argc - 1; ii++)
 			nv_add_string(nv, argv[ii + 1], "resource%d", ii);
 		break;
+	case CMD_LIST:
 	case CMD_STATUS:
 		/* Obtain status of the given resources. */
 		nv = nv_alloc();
@@ -524,6 +532,7 @@ main(int argc, char *argv[])
 	case CMD_ROLE:
 		error = control_set_role(nv, argv[0]);
 		break;
+	case CMD_LIST:
 	case CMD_STATUS:
 		error = control_status(nv);
 		break;


More information about the svn-src-stable-9 mailing list