diff options
author | ajs <ajs> | 2005-01-12 16:24:51 +0000 |
---|---|---|
committer | ajs <ajs> | 2005-01-12 16:24:51 +0000 |
commit | a8a8ddcdd6387466bfb929fe0e9c96003d9509bd (patch) | |
tree | 4ceb281a09fa165580bc58b4ae8d7a1d794794ab /watchquagga | |
parent | e22f5516b3e1431b7716632b76e257b84e7e0ff4 (diff) |
2005-01-12 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* watchquagga.c: (run_job) Fix bug: delay.tv_sec was being used
without having been initialized when the "force" argument was true.
(try_restart) When phased restart is stopping the routing daemons,
it should tell run_job to update the restart interval.
(phase_check) In final step of phased restart when the routing
daemons are being started again, tell run_job not to update
the restart interval (this is now done when the daemons are
stopped).
Diffstat (limited to 'watchquagga')
-rw-r--r-- | watchquagga/ChangeLog | 11 | ||||
-rw-r--r-- | watchquagga/watchquagga.c | 13 |
2 files changed, 19 insertions, 5 deletions
diff --git a/watchquagga/ChangeLog b/watchquagga/ChangeLog index d40c1557..20f974ef 100644 --- a/watchquagga/ChangeLog +++ b/watchquagga/ChangeLog @@ -1,3 +1,14 @@ +2005-01-12 Andrew J. Schorr <ajschorr@alumni.princeton.edu> + + * watchquagga.c: (run_job) Fix bug: delay.tv_sec was being used + without having been initialized when the "force" argument was true. + (try_restart) When phased restart is stopping the routing daemons, + it should tell run_job to update the restart interval. + (phase_check) In final step of phased restart when the routing + daemons are being started again, tell run_job not to update + the restart interval (this is now done when the daemons are + stopped). + 2004-12-29 Andrew J. Schorr <ajschorr@alumni.princeton.edu> * watchquagga.c: In several places, cast pid_t to int for printf to diff --git a/watchquagga/watchquagga.c b/watchquagga/watchquagga.c index fb24d75c..772b4294 100644 --- a/watchquagga/watchquagga.c +++ b/watchquagga/watchquagga.c @@ -1,5 +1,5 @@ /* - $Id: watchquagga.c,v 1.8 2004/12/29 17:45:08 ajs Exp $ + $Id: watchquagga.c,v 1.9 2005/01/12 16:24:51 ajs Exp $ Monitor status of quagga daemons and restart if necessary. @@ -484,8 +484,11 @@ run_job(struct restart_info *restart, const char *cmdtype, const char *command, return -1; } - if (!force && - (time_elapsed(&delay,&restart->time)->tv_sec < restart->interval)) + /* Note: time_elapsed test must come before the force test, since we need + to make sure that delay is initialized for use below in updating the + restart interval. */ + if ((time_elapsed(&delay,&restart->time)->tv_sec < restart->interval) && + !force) { if (gs.loglevel > LOG_DEBUG+1) zlog_debug("postponing %s %s: " @@ -861,7 +864,7 @@ phase_check(void) for (dmn = gs.daemons; dmn; dmn = dmn->next) { if (dmn != gs.special) - run_job(&dmn->restart,"start",gs.start_command,1,1); + run_job(&dmn->restart,"start",gs.start_command,1,0); } } gs.phase = PHASE_NONE; @@ -923,7 +926,7 @@ try_restart(struct daemon *dmn) for (dmn = gs.daemons; dmn; dmn = dmn->next) { if (dmn != gs.special) - run_job(&dmn->restart,"stop",gs.stop_command,1,0); + run_job(&dmn->restart,"stop",gs.stop_command,1,1); } set_phase(PHASE_STOPS_PENDING); break; |