svn commit: r252472 - in head/sbin: hastctl hastd
Mikolaj Golub
trociny at FreeBSD.org
Mon Jul 1 18:41:08 UTC 2013
Author: trociny
Date: Mon Jul 1 18:41:07 2013
New Revision: 252472
URL: http://svnweb.freebsd.org/changeset/base/252472
Log:
Make hastctl(1) ('list' command) output a worker pid.
Reviewed by: pjd
MFC after: 3 days
Modified:
head/sbin/hastctl/hastctl.c
head/sbin/hastd/control.c
Modified: head/sbin/hastctl/hastctl.c
==============================================================================
--- head/sbin/hastctl/hastctl.c Mon Jul 1 17:57:22 2013 (r252471)
+++ head/sbin/hastctl/hastctl.c Mon Jul 1 18:41:07 2013 (r252472)
@@ -293,6 +293,7 @@ control_set_role(struct nv *nv, const ch
static int
control_list(struct nv *nv)
{
+ pid_t pid;
unsigned int ii;
const char *str;
int error, ret;
@@ -331,6 +332,9 @@ control_list(struct nv *nv)
str = nv_get_string(nv, "status%u", ii);
if (str != NULL)
printf(" status: %s\n", str);
+ pid = nv_get_int32(nv, "workerpid%u", ii);
+ if (pid != 0)
+ printf(" workerpid: %d\n", pid);
printf(" dirty: %ju (%NB)\n",
(uintmax_t)nv_get_uint64(nv, "dirty%u", ii),
(intmax_t)nv_get_uint64(nv, "dirty%u", ii));
Modified: head/sbin/hastd/control.c
==============================================================================
--- head/sbin/hastd/control.c Mon Jul 1 17:57:22 2013 (r252471)
+++ head/sbin/hastd/control.c Mon Jul 1 18:41:07 2013 (r252472)
@@ -271,6 +271,7 @@ control_status(struct hastd_config *cfg,
nv_add_string(nvout, compression_name(res->hr_compression),
"compression%u", no);
nv_add_string(nvout, role2str(res->hr_role), "role%u", no);
+ nv_add_int32(nvout, res->hr_workerpid, "workerpid%u", no);
switch (res->hr_role) {
case HAST_ROLE_PRIMARY:
More information about the svn-src-all
mailing list