summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNate Straz <nstraz@redhat.com>2006-08-02 13:00:29 +0000
committerNathan Straz <nstraz@redhat.com>2008-09-23 09:37:46 -0400
commitc750cf3977831da3646bbfa0085147c27f4422ce (patch)
treeda890bac008dfe87a2aee47595be7bf03933cfbb
parent968a156b0a1bdc1fdef4144e5d56ef26ee8083d8 (diff)
downloadqarsh-c750cf3977831da3646bbfa0085147c27f4422ce.zip
qarsh-c750cf3977831da3646bbfa0085147c27f4422ce.tar.gz
qarsh-c750cf3977831da3646bbfa0085147c27f4422ce.tar.xz
Add some more logging to try to nail the false reboot bug.
-rw-r--r--btimed.c6
-rw-r--r--hbeat.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/btimed.c b/btimed.c
index ee758d6..544d108 100644
--- a/btimed.c
+++ b/btimed.c
@@ -26,6 +26,7 @@ main(int argc, char **argv)
struct sockaddr_in cli_addr;
int cli_addr_len;
ssize_t nbytes;
+ unsigned int local_btime;
openlog("btimed", LOG_PID, LOG_USER);
@@ -37,8 +38,10 @@ main(int argc, char **argv)
/* Generate the standard btime message */
memset(outmsg, 0, BTIME_MSGLEN);
- sprintf(outmsg, "%u\n", get_btime());
+ local_btime = get_btime();
+ sprintf(outmsg, "%u\n", local_btime);
+ syslog(LOG_INFO, "started with btime = %u", local_btime);
for (;;) {
memset(&cli_addr, 0, sizeof cli_addr);
cli_addr_len = sizeof cli_addr;
@@ -49,6 +52,7 @@ main(int argc, char **argv)
/* Bail, we may have had an alarm(), or other error.
* client side resends request, no need to retry here.
*/
+ syslog(LOG_INFO, "exitting");
exit(0);
}
diff --git a/hbeat.c b/hbeat.c
index c2456ca..b747516 100644
--- a/hbeat.c
+++ b/hbeat.c
@@ -9,6 +9,7 @@
#include <stdlib.h>
#include <sys/types.h>
#include <time.h>
+#include <stdio.h>
#include "btime.h"
#include "hbeat.h"
@@ -110,6 +111,8 @@ hbeat(hbeat_t hbh)
hbeatp->last_rhost_btime = hbeat;
retval = 1;
} else if (abs(hbeat - hbeatp->last_rhost_btime) > 5) {
+ fprintf(stderr, "Host rebooted (%d, %d)\n",
+ hbeat, hbeatp->last_rhost_btime);
hbeatp->rhost_state = HOST_REBOOT;
retval = 0;
} else {