summaryrefslogtreecommitdiff
path: root/zhm
diff options
context:
space:
mode:
authorGravatar Jeffrey Hutzelman <jhutz@cmu.edu>2013-02-07 17:09:56 -0500
committerGravatar Jeffrey Hutzelman <jhutz@cmu.edu>2013-02-14 19:57:32 -0500
commitf8fd0932c84b1642a71f78ad72e87d1842a1d2ab (patch)
tree03b7f78ec8daa6b22380c3c410b17d095fec77ba /zhm
parentf33026a3f80b7ed827a0539c65b44a290dbc7424 (diff)
zhm: Don't send HM_BOOT on new_server if -N used
If -N was used, then not only should the hostmanager not send an HM_BOOT to the first server it contacts; it should also not send one to other servers it tries when the first one fails to respond. However, it should consistently send HM_BOOT when coming back from a SIGHUP deactivation where it has previously sent HM_FLUSH (if you don't want that behavior, use -f and avoid sending SIGHUP to the hostmanager). This fixes #88
Diffstat (limited to 'zhm')
-rw-r--r--zhm/zhm.c9
-rw-r--r--zhm/zhm_server.c2
2 files changed, 5 insertions, 6 deletions
diff --git a/zhm/zhm.c b/zhm/zhm.c
index bd888d0..cbdcf6d 100644
--- a/zhm/zhm.c
+++ b/zhm/zhm.c
@@ -28,7 +28,6 @@ int use_hesiod = 0;
int hmdebug, rebootflag, noflushflag, errflg, dieflag, inetd, oldpid, nofork;
int no_server = 1, nservchang, nserv, nclt;
int booting = 1, timeout_type, deactivated = 1;
-int bootflag = 1;
int started = 0;
long starttime;
u_short cli_port;
@@ -106,9 +105,9 @@ main(int argc,
case 'f':
noflushflag = 1;
break;
- case 'N':
- bootflag = 0;
- break;
+ case 'N':
+ booting = 0;
+ break;
case '?':
default:
errflg++;
@@ -440,7 +439,7 @@ init_hm(void)
memcpy(&serv_sin.sin_addr, hp->h_addr, 4);
}
- if (bootflag)
+ if (booting)
send_boot_notice(HM_BOOT);
else
send_boot_notice(HM_ATTACH);
diff --git a/zhm/zhm_server.c b/zhm/zhm_server.c
index 0209054..0cce960 100644
--- a/zhm/zhm_server.c
+++ b/zhm/zhm_server.c
@@ -283,7 +283,7 @@ new_server(char *sugg_serv)
syslog (LOG_INFO, "Server went down, finding new server.");
send_flush_notice(HM_DETACH);
find_next_server(sugg_serv);
- if (booting) {
+ if (booting || deactivated) {
send_boot_notice(HM_BOOT);
deactivated = 0;
} else {