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

Diff of /monit/control.c

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

revision 1.62 by martinp, Wed Aug 27 01:42:40 2003 UTC revision 1.63 by martinp, Wed Aug 27 08:47:04 2003 UTC
# Line 240  void check_service(char *P, char *action Line 240  void check_service(char *P, char *action
240            
241    } else if(IS(action, "monitor")) {    } else if(IS(action, "monitor")) {
242            
243        /* We only enable monitoring of this service and all prerequisite
244         * services. Chain of services which depends on this service keep
245         * its state */
246      do_monitor(s);      do_monitor(s);
247            
248    } else if(IS(action, "unmonitor")) {    } else if(IS(action, "unmonitor")) {
249            
250        /* We disable monitoring of this service and all services which
251         * depends on it */
252        do_depend(s, "unmonitor");
253      do_unmonitor(s);      do_unmonitor(s);
254            
255    }    }
# Line 405  static void do_unmonitor(Service_T s) { Line 411  static void do_unmonitor(Service_T s) {
411    /* Reset the proc info object in case of a later restart */    /* Reset the proc info object in case of a later restart */
412    memset(s->procinfo, 0, sizeof *(s->procinfo));    memset(s->procinfo, 0, sizeof *(s->procinfo));
413        
   if(s->dependantlist) {  
       
     Dependant_T d;  
       
     for(d= s->dependantlist; d; d= d->next ) {  
         
       Service_T parent= get_service(d->dependant);  
       ASSERT(parent);  
       do_unmonitor(parent);  
         
     }  
   }  
414  }  }
415    
416    
# Line 483  static void do_depend(Service_T s, char Line 477  static void do_depend(Service_T s, char
477                    
478            if(IS(action, "start"))            if(IS(action, "start"))
479              do_start(child);              do_start(child);
480              else if(IS(action, "monitor"))
481                do_monitor(child);
482                    
483            do_depend(child, action);            do_depend(child, action);
484                    
485            if(IS(action, "stop"))            if(IS(action, "stop"))
486              do_stop(child);              do_stop(child);
487              else if(IS(action, "unmonitor"))
488                do_unmonitor(child);
489    
490            return;            return;
491    

Legend:
Removed from v.1.62  
changed lines
  Added in v.1.63

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