diff options
author | Nathan Straz <nstraz@redhat.com> | 2014-02-25 09:38:58 -0500 |
---|---|---|
committer | Nathan Straz <nstraz@redhat.com> | 2014-02-25 10:07:17 -0500 |
commit | 10a03d9299757a14525e1177ef34f68b316be1f0 (patch) | |
tree | 9442fa474010ab28d77eff1885c6bd701d17fa71 /qarsh.c | |
parent | b195059bc8c9c7ff59538d908e81022d94515400 (diff) | |
download | qarsh-10a03d9299757a14525e1177ef34f68b316be1f0.tar.gz qarsh-10a03d9299757a14525e1177ef34f68b316be1f0.tar.xz qarsh-10a03d9299757a14525e1177ef34f68b316be1f0.zip |
Include host name in reboot and host down messages
After a long running command or when multiple qarsh processes
are running in parallel, it's hard to know which host is having
trouble when a "Remote host rebooted" message shows up. Include
the host name in these message to make them more informative.
Diffstat (limited to 'qarsh.c')
-rw-r--r-- | qarsh.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -57,6 +57,7 @@ int signal_to_send = 0; int sigs_to_propogate[] = { SIGINT, SIGTERM, SIGHUP, SIGUSR1, SIGUSR2 }; sigset_t pselect_sigmask; int connection_timeout = 0; +char *host = NULL; void @@ -423,15 +424,15 @@ run_remote_cmd(char *cmdline) } } if (hbeat_getstate(qarsh_hb) == HOST_TIMEOUT) { - fprintf(stderr, "Didn't receive heartbeat for %d seconds\n", - hbeat_getmaxtimeout(qarsh_hb)); + fprintf(stderr, "Didn't receive heartbeat from %s for %d seconds\n", + host, hbeat_getmaxtimeout(qarsh_hb)); return W_EXITCODE(127, 0); } else if (hbeat_getstate(qarsh_hb) == HOST_REBOOT) { - fprintf(stderr, "Remote host rebooted\n"); + fprintf(stderr, "Remote host %s rebooted\n", host); return W_EXITCODE(127, 0); } if (!cmd_finished) { - fprintf(stderr, "Remote command exited with unknown state\n"); + fprintf(stderr, "Remote command on %s exited with unknown state\n", host); return W_EXITCODE(127, 0); } return rc; @@ -442,7 +443,6 @@ main(int argc, char *argv[]) { int c; int port = 5016; - char *host = NULL; char *remuser = NULL; char *remgroup = NULL; char *args; |