Minor, refactor

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2018-10-02 13:18:15 +02:00
parent a40858f162
commit 4790344fbe
2 changed files with 6 additions and 4 deletions
+3 -4
View File
@@ -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);
}
}
+3
View File
@@ -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.