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

Diff of /monit/control.c

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

revision 1.66 by hauk, Tue Sep 2 02:05:48 2003 UTC revision 1.67 by martinp, Mon Sep 15 19:49:57 2003 UTC
# Line 84  static void  do_depend(Service_T, char * Line 84  static void  do_depend(Service_T, char *
84    
85    
86  /**  /**
87   * Start/stop all processes in service list   * Handle the action for all processes in service list
88   * @param action A string describing the action to execute   * @param action A string describing the action to execute
89   */   */
90  void control(char *action) {  void control(char *action) {
# Line 109  void control(char *action) { Line 109  void control(char *action) {
109    
110    
111  /*  /*
112   * Start/stop all processes in a group   * Handle the action for all processes in a group
113   * @param G group name   * @param G group name
114   * @param action A string describing the action to execute   * @param action A string describing the action to execute
115   */   */
# Line 137  void control_group(char *G, char *action Line 137  void control_group(char *G, char *action
137  }  }
138    
139    
140    /*
141     * Handle the action for a specified process
142     * @param P process name
143     * @param action A string describing the action to execute
144     */
145    void control_process(char *P, char *action) {
146    
147      Service_T s;
148    
149      ASSERT(P);
150      ASSERT(action);
151    
152      if(NULL==(s= get_service(P))) {
153        log("%s: Cannot %s program '%s' -- not found in %s\n",
154              prog, action, P, Run.controlfile);
155        return;
156      }
157    
158      if(exist_daemon()) {
159        d_check_service(P, action);
160      } else {
161        check_service(P, action);
162      }
163    
164    }
165    
166    
167  /**  /**
168   * Pass on to methods in http/cervlet.c to start/stop services   * Pass on to methods in http/cervlet.c to start/stop services
169   * @param P A service name as stated in the config file   * @param P A service name as stated in the config file
# Line 429  static void monitor_set(Service_T s) { Line 456  static void monitor_set(Service_T s) {
456      LOCK(Run.mutex)      LOCK(Run.mutex)
457        s->do_monitor= TRUE;        s->do_monitor= TRUE;
458      END_LOCK;      END_LOCK;
459      DEBUG("Monitoring enabled -- process %s\n", s->name);      DEBUG("Monitoring enabled -- service %s\n", s->name);
460    }    }
461    
462  }  }
# Line 447  static void monitor_unset(Service_T s) { Line 474  static void monitor_unset(Service_T s) {
474      LOCK(Run.mutex)      LOCK(Run.mutex)
475        s->do_monitor= FALSE;        s->do_monitor= FALSE;
476      END_LOCK;      END_LOCK;
477      DEBUG("Monitoring disabled -- process %s\n", s->name);      DEBUG("Monitoring disabled -- service %s\n", s->name);
478    }    }
479    
480  }  }

Legend:
Removed from v.1.66  
changed lines
  Added in v.1.67

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