diff --git a/src/service.c b/src/service.c index 813ae218..3f1e27e5 100644 --- a/src/service.c +++ b/src/service.c @@ -990,11 +990,10 @@ static void svc_set_state(svc_t *svc, svc_state_t new) *state = new; - /* if the PID isn't collected within 3s, kill it! */ - if ((*state == SVC_STOPPING_STATE) && - !svc_is_inetd(svc)) { + /* if PID isn't collected within SVC_TERM_TIMEOUT msec, kill it! */ + if ((*state == SVC_STOPPING_STATE) && !svc_is_inetd(svc)) { service_timeout_cancel(svc); - service_timeout_after(svc, 3000, service_kill); + service_timeout_after(svc, SVC_TERM_TIMEOUT, service_kill); } } diff --git a/src/svc.h b/src/svc.h index 53189e0e..3e14d4f2 100644 --- a/src/svc.h +++ b/src/svc.h @@ -73,6 +73,9 @@ typedef enum { #define MAX_NUM_FDS 64 /* Max number of I/O plugins */ #define MAX_NUM_SVC_ARGS 32 +/* Time after SIGTERM that we SIGKILL stopping processes */ +#define SVC_TERM_TIMEOUT 3000 + /* * Default enable for all services, can be stopped by means * of issuing an initctl call. E.g.