procd: Allow process respawning forever
authorHelmut Schaa <helmut.schaa@googlemail.com>
Fri, 15 Nov 2013 18:32:31 +0000 (19:32 +0100)
committerJohn Crispin <blogic@openwrt.org>
Fri, 15 Nov 2013 18:33:35 +0000 (19:33 +0100)
Use respawn_retry==0 as indication to respawn a process forever.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John Crispin <blogic@openwrt.org>
service/instance.c

index 5ac7d5704241020eebe13439bff64992850d9524..ab517d74d485ae0bdc8bce4965e19c1c8c4b11eb 100644 (file)
@@ -164,7 +164,7 @@ instance_exit(struct uloop_process *p, int ret)
                        in->respawn_count++;
                else
                        in->respawn_count = 0;
-               if (in->respawn_count > in->respawn_retry) {
+               if (in->respawn_count > in->respawn_retry && in->respawn_retry > 0 ) {
                        LOG("Instance %s::%s s in a crash loop %d crashes, %ld seconds since last crash\n",
                                                                in->srv->name, in->name, in->respawn_count, runtime);
                        in->restart = in->respawn = 0;