From 5092fcd6407b7957943a19df1a41c997dce8a9cf Mon Sep 17 00:00:00 2001 From: trociny Date: Mon, 1 Jul 2013 18:41:07 +0000 Subject: Make hastctl(1) ('list' command) output a worker pid. Reviewed by: pjd MFC after: 3 days --- sbin/hastctl/hastctl.c | 4 ++++ sbin/hastd/control.c | 1 + 2 files changed, 5 insertions(+) diff --git a/sbin/hastctl/hastctl.c b/sbin/hastctl/hastctl.c index 6fe55fa..11b5b8d 100644 --- a/sbin/hastctl/hastctl.c +++ b/sbin/hastctl/hastctl.c @@ -293,6 +293,7 @@ control_set_role(struct nv *nv, const char *newrole) 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)); diff --git a/sbin/hastd/control.c b/sbin/hastd/control.c index 3619fc6..922f507 100644 --- a/sbin/hastd/control.c +++ b/sbin/hastd/control.c @@ -271,6 +271,7 @@ control_status(struct hastd_config *cfg, struct nv *nvout, 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: -- cgit v1.1