/[monit]/monit/monitor.c
ViewVC logotype

Diff of /monit/monitor.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.121 by martinp, Sun Sep 11 14:57:02 2005 UTC revision 1.122 by martinp, Sat Nov 5 14:09:00 2005 UTC
# Line 67  Line 67 
67  #include "md5.h"  #include "md5.h"
68  #include "sha.h"  #include "sha.h"
69  #include "state.h"  #include "state.h"
70    #include "event.h"
71    
72    
73  /**  /**
# Line 331  static void do_reinit() { Line 332  static void do_reinit() {
332    if(can_http())    if(can_http())
333      monit_http(START_HTTP);      monit_http(START_HTTP);
334    
335      /* send the monit startup notification */
336      Event_post(Run.system, EVENT_INSTANCE, STATE_FAILED,
337        Run.system->action_MONIT_RELOAD, "Monit reloaded");
338    
339  }  }
340    
341    
# Line 416  static void do_exit() { Line 421  static void do_exit() {
421    
422      log("%s daemon with pid [%d] killed\n", prog, (int)getpid());      log("%s daemon with pid [%d] killed\n", prog, (int)getpid());
423    
424        /* send the monit stop notification */
425        Event_post(Run.system, EVENT_INSTANCE, STATE_FAILED,
426          Run.system->action_MONIT_STOP, "Monit stopped");
427    
428    }    }
429    
430    /* wait for all wait_start threads to finish */    /* wait for all wait_start threads to finish */
# Line 465  static void do_default() { Line 474  static void do_default() {
474      if(can_http())      if(can_http())
475        monit_http(START_HTTP);        monit_http(START_HTTP);
476            
477        /* send the monit startup notification */
478        Event_post(Run.system, EVENT_INSTANCE, STATE_FAILED,
479          Run.system->action_MONIT_START, "Monit started");
480    
481      for(;;) {      for(;;) {
482    
483        validate();        validate();
# Line 472  static void do_default() { Line 485  static void do_default() {
485        sleep(Run.polltime);        sleep(Run.polltime);
486    
487        if(Run.doreload)        if(Run.doreload)
488          do_reinit();          do_reinit();
489                
490        if(Run.stopped)        if(Run.stopped)
491          do_exit();          do_exit();
492                
493      }      }
494            

Legend:
Removed from v.1.121  
changed lines
  Added in v.1.122

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26