126 |
switch(action) { |
switch(action) { |
127 |
|
|
128 |
case STOP_HTTP: |
case STOP_HTTP: |
129 |
log("Stopping %s HTTP server\n", prog); |
log("%s HTTP server stopping\n", prog); |
130 |
stop_httpd(); |
stop_httpd(); |
131 |
|
if( (status= pthread_join(thread, NULL)) != 0) { |
132 |
|
log("%s: Failed to stop the http server. Thread error -- %s.\n", |
133 |
|
prog, strerror(status)); |
134 |
|
} else { |
135 |
|
log("%s HTTP server stopped\n", prog); |
136 |
|
} |
137 |
break; |
break; |
138 |
|
|
139 |
case START_HTTP: |
case START_HTTP: |
161 |
|
|
162 |
sigset_t ns; |
sigset_t ns; |
163 |
|
|
|
pthread_detach(pthread_self()); |
|
164 |
/* Block collective signals in the http thread. The http server is |
/* Block collective signals in the http thread. The http server is |
165 |
* taken down gracefully by signaling the main monit thread */ |
* taken down gracefully by signaling the main monit thread */ |
166 |
set_signal_block(&ns, NULL); |
set_signal_block(&ns, NULL); |