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) { |
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 |
*/ |
*/ |
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 |
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 |
} |
} |
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 |
} |
} |