diff options
author | trociny <trociny@FreeBSD.org> | 2013-07-01 18:41:07 +0000 |
---|---|---|
committer | trociny <trociny@FreeBSD.org> | 2013-07-01 18:41:07 +0000 |
commit | 5092fcd6407b7957943a19df1a41c997dce8a9cf (patch) | |
tree | a6efa54fbdfc5a522fc71ccce8c8225d8e3f8854 /sbin | |
parent | cab3cc571031cfdb601898df1b6e7c531d5f87ce (diff) | |
download | FreeBSD-src-5092fcd6407b7957943a19df1a41c997dce8a9cf.zip FreeBSD-src-5092fcd6407b7957943a19df1a41c997dce8a9cf.tar.gz |
Make hastctl(1) ('list' command) output a worker pid.
Reviewed by: pjd
MFC after: 3 days
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/hastctl/hastctl.c | 4 | ||||
-rw-r--r-- | sbin/hastd/control.c | 1 |
2 files changed, 5 insertions, 0 deletions
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: |