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

Diff of /monit/control.c

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

revision 1.37 by martinp, Mon Feb 10 00:09:19 2003 UTC revision 1.38 by martinp, Mon Feb 10 07:40:40 2003 UTC
# Line 293  static void do_start(Process_T p) { Line 293  static void do_start(Process_T p) {
293      }      }
294    }    }
295        
296      if(p->start && (!is_process_running(p))) {
297        log("start: (%s) %s\n", p->name, p->start->arg[0]);
298        spawn(p, p->start);
299        wait_start(p);
300      }
301      
302    LOCK(Run.mutex)    LOCK(Run.mutex)
303      p->do_validate= TRUE;      p->do_validate= TRUE;
304    END_LOCK;    END_LOCK;
# Line 300  static void do_start(Process_T p) { Line 306  static void do_start(Process_T p) {
306    if(Run.debug)    if(Run.debug)
307      log("Monitoring enabled -- process %s\n", p->name);      log("Monitoring enabled -- process %s\n", p->name);
308    
   if(p->start && (!is_process_running(p))) {  
     log("start: (%s) %s\n", p->name, p->start->arg[0]);  
     spawn(p, p->start);  
     wait_start(p);  
   }  
     
309  }  }
310    
311    
# Line 322  static void do_stop(Process_T p) { Line 322  static void do_stop(Process_T p) {
322        
323    p->depend_visited= TRUE;    p->depend_visited= TRUE;
324        
325      LOCK(Run.mutex)
326        p->do_validate= FALSE;
327      END_LOCK;
328    
329      if(Run.debug)
330        log("Monitoring disabled -- process %s\n", p->name);
331    
332    if(p->stop && is_process_running(p)) {    if(p->stop && is_process_running(p)) {
333      log("stop: (%s) %s\n", p->name, p->stop->arg[0]);      log("stop: (%s) %s\n", p->name, p->stop->arg[0]);
334      spawn(p, p->stop);      spawn(p, p->stop);
# Line 331  static void do_stop(Process_T p) { Line 338  static void do_stop(Process_T p) {
338    /* Reset the proc info object in case of a later restart */    /* Reset the proc info object in case of a later restart */
339    memset(p->procinfo, 0, sizeof *(p->procinfo));    memset(p->procinfo, 0, sizeof *(p->procinfo));
340        
   LOCK(Run.mutex)  
     p->do_validate= FALSE;  
   END_LOCK;  
   
   if(Run.debug)  
     log("Monitoring disabled -- process %s\n", p->name);  
   
341  }  }
342    
343    

Legend:
Removed from v.1.37  
changed lines
  Added in v.1.38

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