From: Jurgen Van Ham Date: Fri, 10 Feb 2017 06:55:23 +0000 (+0100) Subject: procd: add cancel_timeout on rc scripts when a runtime_timeout is specified X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fprocd.git;a=commitdiff_plain;h=5f9124103410c178d816bb5229fba7dd2286a49b procd: add cancel_timeout on rc scripts when a runtime_timeout is specified Enable procd to restrict the execution time of a rc scripts during shutdown, even when a script ignores the SIGTERM signal by insisting after 10s with a SIGKILL. Signed-off-by: Jurgen Van Ham --- diff --git a/rcS.c b/rcS.c index 1e38d39..0208a75 100644 --- a/rcS.c +++ b/rcS.c @@ -121,8 +121,10 @@ static void add_initd(struct runqueue *q, char *file, char *param) } s->proc.task.type = &initd_type; s->proc.task.complete = q_initd_complete; - if (!strcmp(param, "stop") || !strcmp(param, "shutdown")) + if (!strcmp(param, "stop") || !strcmp(param, "shutdown")) { s->proc.task.run_timeout = 15000; + s->proc.task.cancel_timeout = 10000; + } s->param = p; s->file = f; strcpy(s->param, param);