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

Diff of /monit/monitor.c

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

revision 1.30 by martinp, Tue Dec 3 09:10:46 2002 UTC revision 1.31 by rory, Thu Dec 5 01:36:27 2002 UTC
# Line 163  static void do_init() { Line 163  static void do_init() {
163     */     */
164    
165    if(! parse(Run.controlfile)) {    if(! parse(Run.controlfile)) {
166        log("I should only be here once\n");
167            
168      exit(1);      exit(1);
169            
# Line 272  static void do_action(char **args) { Line 273  static void do_action(char **args) {
273            
274    } else if(is(action, "start")) {    } else if(is(action, "start")) {
275            
276      if(P)      if(P) {
277          if( exist_daemon() ) {
278            d_check_process(P, "start");
279          } else {
280          check_process(P, "start", TRUE);          check_process(P, "start", TRUE);
281      else {        }
282        } else {
283                
284        if(mygroup)        if(mygroup)
285            control_group(mygroup, "start", TRUE);          control_group(mygroup, "start", TRUE);
286        else        else
287            control("start", TRUE);          control("start", TRUE);
288      }      }
289        
290    } else if(is(action, "stop")) {    } else if(is(action, "stop")) {
291            
292      if(P)      if(P) {
293          if( exist_daemon() ) {
294            d_check_process(P, "stop");
295          } else {
296          check_process(P, "stop", TRUE);          check_process(P, "stop", TRUE);
297      else {        }
298        } else {
299                
300        if(mygroup)        if(mygroup)
301            control_group(mygroup, "stop", TRUE);          control_group(mygroup, "stop", TRUE);
302        else        else
303            control("stop", TRUE);          control("stop", TRUE);
304      }      }
305            
306    } else if(is(action, "restart")) {    } else if(is(action, "restart")) {
# Line 307  static void do_action(char **args) { Line 316  static void do_action(char **args) {
316                    
317        }        }
318                
319        check_process(P, "stop", FALSE);        if( exist_daemon() ) {
320            d_check_process(P, "stop");
321          } else {
322            check_process(P, "stop", FALSE);
323          }
324                
325      } else {      } else {
326                
# Line 319  static void do_action(char **args) { Line 332  static void do_action(char **args) {
332            
333      do_wait();      do_wait();
334            
335      if(P)      if(P) {
336          if( exist_daemon() ) {
337            d_check_process(P, "start");
338          } else {
339          check_process(P, "start", TRUE);          check_process(P, "start", TRUE);
340      else {        }
341        } else {
342                
343        if(mygroup)        if(mygroup)
344            control_group(mygroup, "start", TRUE);            control_group(mygroup, "start", TRUE);
# Line 331  static void do_action(char **args) { Line 348  static void do_action(char **args) {
348            
349    } else if(is(action, "status")) {    } else if(is(action, "status")) {
350            
351      if(mygroup)      if(mygroup) {
352          status_group(mygroup);        status_group(mygroup);
353      else      } else {
354          status();        status();
355        }
356            
357    } else if(is(action, "quit")) {    } else if(is(action, "quit")) {
358            
# Line 462  static void do_default() { Line 480  static void do_default() {
480      }      }
481            
482      for(;;) {      for(;;) {
483          
484        if(Run.validate != TRUE) {        if(Run.validate != TRUE) {
485          validate();          validate();
486        } else {        } else {
# Line 470  static void do_default() { Line 488  static void do_default() {
488        }        }
489    
490        sleep(Run.polltime);        sleep(Run.polltime);
491          
492        if(is_rcfile_changed()) {        if(is_rcfile_changed()) {
493                    
494          int port= Run.httpdport;          int port= Run.httpdport;
# Line 493  static void do_default() { Line 511  static void do_default() {
511          }          }
512                    
513        }        }
514              
515    
516      }      }
517            
518    }    }

Legend:
Removed from v.1.30  
changed lines
  Added in v.1.31

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