On Tue, Jan 14, 2014 at 8:19 PM, Bastian Bittorf <[email protected]> wrote:
> * John Crispin <[email protected]> [14.01.2014 19:55]:
>> > sometimes I experience hangs when rebooting.
>
> there are already some bugs on tra open regarding this.
>
>> > As far as I can see procd does not try to kill any
>> > started services but relies on them to exit gracefully.
>> >
>> > Would it make sense to kill the services after a
>> > reasonable timeout?
>>
>> i have not seen this happen, do you have a reliable testcase or is this
>> just an observation you made ?
>>
>> yes, a forced shutdown would make sense, i need to look at the code to
>> make a better judgement though.
>>
>> any ideas on what a good timeout would be ? i guess we are shutting down
>> so a forced quit after 15s seems legit to me
>
> difficult! at least we must make sure that "sync" has enough time,
> this can last longer - keep in mind that OpenWrt also runs on big
> boxes...if you ask me: just wait 600 sec 8-) at least it is important
> that the box _does_ reboot and hangs not forever.

procd already runs sync before triggering the final reboot (after
stopping all services).
So, maybe its enough to just add a generic timeout for
procd_inittab_run("shutdown").

Or instead we could use a timeout for every init script that needs to
be stopped.
As far as I can see it might be enough to add a timeout for all runqueue tasks:

diff --git a/rcS.c b/rcS.c
index 395d992..332201e 100644
--- a/rcS.c
+++ b/rcS.c
@@ -115,6 +115,7 @@ static void add_initd(struct runqueue *q, char
*file, char *param)
        s = calloc_a(sizeof(*s), &f, strlen(file) + 1, &p, strlen(param) + 1);
        s->proc.task.type = &initd_type;
        s->proc.task.complete = q_initd_complete;
+       s->proc.task.run_timeout = 10000;
        s->param = p;
        s->file = f;
        strcpy(s->param, param);


> the same applies
> for bootup which also can hang. (but the underlying netifd(?)-bug must
> be found...)

Not sure if it is netifd in my case ...
Helmut
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to