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

Diff of /monit/monitor.c

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

revision 1.35 by hauk, Tue Dec 17 21:37:09 2002 UTC revision 1.36 by hauk, Thu Dec 19 20:50:06 2002 UTC
# Line 194  static void do_init() { Line 194  static void do_init() {
194    /*    /*
195     * Should we print debug information ?     * Should we print debug information ?
196     */     */
197    if(Run.debug && have_tty) {    if(Run.debug && Run.have_tty) {
198            
199      printrunlist();      printrunlist();
200      printprocesslist();      printprocesslist();
# Line 272  static void do_action(char **args) { Line 272  static void do_action(char **args) {
272    } else if(is(action, "start")) {    } else if(is(action, "start")) {
273            
274      if(P) {      if(P) {
275        if( exist_daemon() ) {        if(exist_daemon()) {
276          d_check_process(P, "start");          d_check_process(P, "start");
277        } else {        } else {
278          check_process(P, "start", TRUE);          check_process(P, "start", TRUE);
279        }        }
280      } else {      } else {
281                
282        if(mygroup)        if(Run.mygroup)
283          control_group(mygroup, "start", TRUE);          control_group(Run.mygroup, "start", TRUE);
284        else        else
285          control("start", TRUE);          control("start", TRUE);
286      }      }
# Line 288  static void do_action(char **args) { Line 288  static void do_action(char **args) {
288    } else if(is(action, "stop")) {    } else if(is(action, "stop")) {
289            
290      if(P) {      if(P) {
291        if( exist_daemon() ) {        if(exist_daemon()) {
292          d_check_process(P, "stop");          d_check_process(P, "stop");
293        } else {        } else {
294          check_process(P, "stop", TRUE);          check_process(P, "stop", TRUE);
295        }        }
296      } else {      } else {
297                
298        if(mygroup)        if(Run.mygroup)
299          control_group(mygroup, "stop", TRUE);          control_group(Run.mygroup, "stop", TRUE);
300        else        else
301          control("stop", TRUE);          control("stop", TRUE);
302      }      }
# Line 314  static void do_action(char **args) { Line 314  static void do_action(char **args) {
314                    
315        }        }
316                
317        if( exist_daemon() ) {        if(exist_daemon()) {
318          d_check_process(P, "stop");          d_check_process(P, "stop");
319        } else {        } else {
320          check_process(P, "stop", FALSE);          check_process(P, "stop", FALSE);
# Line 322  static void do_action(char **args) { Line 322  static void do_action(char **args) {
322                
323      } else {      } else {
324                
325        if(mygroup)        if(Run.mygroup)
326            control_group(mygroup, "stop", FALSE);            control_group(Run.mygroup, "stop", FALSE);
327        else        else
328            control("stop", FALSE);            control("stop", FALSE);
329      }      }
# Line 331  static void do_action(char **args) { Line 331  static void do_action(char **args) {
331      do_wait();      do_wait();
332            
333      if(P) {      if(P) {
334        if( exist_daemon() ) {        if(exist_daemon()) {
335          d_check_process(P, "start");          d_check_process(P, "start");
336        } else {        } else {
337          check_process(P, "start", TRUE);          check_process(P, "start", TRUE);
338        }        }
339      } else {      } else {
340                
341        if(mygroup)        if(Run.mygroup)
342            control_group(mygroup, "start", TRUE);            control_group(Run.mygroup, "start", TRUE);
343        else        else
344            control("start", TRUE);            control("start", TRUE);
345      }      }
346            
347    } else if(is(action, "status")) {    } else if(is(action, "status")) {
348            
349      if(mygroup) {      if(Run.mygroup) {
350        status_group(mygroup);        status_group(Run.mygroup);
351      } else {      } else {
352        status();        status();
353      }      }
# Line 498  static void do_default() { Line 498  static void do_default() {
498                        
499            stop_http();            stop_http();
500                        
501          } else if( !is(bind_addr, Run.bind_addr) || port != Run.httpdport ) {          } else if(!is(bind_addr, Run.bind_addr) || port != Run.httpdport) {
502                        
503            stop_http();            stop_http();
504            start_http();            start_http();
# Line 537  static void handle_options(int argc, cha Line 537  static void handle_options(int argc, cha
537    
538    opterr= 0;    opterr= 0;
539    
540    mygroup=0;    Run.mygroup=0;
541    
542    while((rval= getopt(argc,argv,"c:d:g:l:iIvVh")) != -1) {    while((rval= getopt(argc,argv,"c:d:g:l:iIvVh")) != -1) {
543    
# Line 560  static void handle_options(int argc, cha Line 560  static void handle_options(int argc, cha
560          break;          break;
561    
562      case 'g':      case 'g':
563          mygroup= xstrdup(optarg);          Run.mygroup= xstrdup(optarg);
564          break;          break;
565                    
566      case 'l':      case 'l':
# Line 664  static void do_wait() { Line 664  static void do_wait() {
664        
665    int i;    int i;
666    
667    if(have_tty) {    if(Run.have_tty) {
668            
669      fprintf(stdout, "Please wait for restart: ");      fprintf(stdout, "Please wait for restart: ");
670            

Legend:
Removed from v.1.35  
changed lines
  Added in v.1.36

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