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

Diff of /monit/control.c

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

revision 1.58 by hauk, Wed Aug 6 00:53:17 2003 UTC revision 1.59 by martinp, Wed Aug 6 13:10:51 2003 UTC
# Line 179  void check_service(char *P, char *action Line 179  void check_service(char *P, char *action
179    
180    if(IS(action, "start")) {    if(IS(action, "start")) {
181            
182      if(s->task==TASK_PROCESS && is_process_running(s)) {      if(s->type==TYPE_PROCESS && is_process_running(s)) {
183    
184        if(!s->do_monitor) {        if(!s->do_monitor) {
185    
# Line 194  void check_service(char *P, char *action Line 194  void check_service(char *P, char *action
194        return;        return;
195      }      }
196            
197      if(s->task==TASK_PROCESS && !s->start) {      if(s->type==TYPE_PROCESS && !s->start) {
198        DEBUG("%s: Start method not defined -- process %s\n",        DEBUG("%s: Start method not defined -- process %s\n",
199              prog, P);              prog, P);
200        return;        return;
# Line 206  void check_service(char *P, char *action Line 206  void check_service(char *P, char *action
206            
207    } else if(IS(action, "stop")) {    } else if(IS(action, "stop")) {
208            
209      if(s->task==TASK_PROCESS && !s->stop) {      if(s->type==TYPE_PROCESS && !s->stop) {
210        DEBUG("%s: Stop method not defined -- process %s\n",        DEBUG("%s: Stop method not defined -- process %s\n",
211              prog, P);              prog, P);
212        return;        return;
# Line 217  void check_service(char *P, char *action Line 217  void check_service(char *P, char *action
217            
218    } else if(IS(action, "restart")) {    } else if(IS(action, "restart")) {
219            
220      if(s->task==TASK_PROCESS && (!s->start || !s->stop)) {      if(s->type==TYPE_PROCESS && (!s->start || !s->stop)) {
221        DEBUG("%s: Start or stop method not defined -- process %s\n",        DEBUG("%s: Start or stop method not defined -- process %s\n",
222              prog, P);              prog, P);
223        return;        return;
# Line 282  static void do_start(Service_T s) { Line 282  static void do_start(Service_T s) {
282      }      }
283    }    }
284        
285    if(s->start && (s->task==TASK_PROCESS || !is_process_running(s))) {    if(s->start && (s->type==TYPE_PROCESS || !is_process_running(s))) {
286      int status;      int status;
287      pthread_t thread;      pthread_t thread;
288      log("start: (%s) %s\n", s->name, s->start->arg[0]);      log("start: (%s) %s\n", s->name, s->start->arg[0]);
# Line 326  static int do_stop(Service_T s) { Line 326  static int do_stop(Service_T s) {
326    /* Reset the proc info object in case of a later restart */    /* Reset the proc info object in case of a later restart */
327    memset(s->procinfo, 0, sizeof *(s->procinfo));    memset(s->procinfo, 0, sizeof *(s->procinfo));
328        
329    if(s->stop && (s->task==TASK_PROCESS || is_process_running(s))) {    if(s->stop && (s->type==TYPE_PROCESS || is_process_running(s))) {
330      log("stop: (%s) %s\n", s->name, s->stop->arg[0]);      log("stop: (%s) %s\n", s->name, s->stop->arg[0]);
331      spawn(s, s->stop);      spawn(s, s->stop);
332            

Legend:
Removed from v.1.58  
changed lines
  Added in v.1.59

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