summaryrefslogtreecommitdiffstats
path: root/inittab.c
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2013-06-24 18:31:51 +0200
committerJohn Crispin <blogic@openwrt.org>2013-06-24 18:31:51 +0200
commit3018420f7fd004b48715100d2f60b27c64d48b75 (patch)
treeacf107dbba9ef78350578241e74d39d582e00e00 /inittab.c
parentc23413feeb5179911d623e6ffb84b36671652788 (diff)
downloadunitd-3018420f7fd004b48715100d2f60b27c64d48b75.tar
unitd-3018420f7fd004b48715100d2f60b27c64d48b75.zip
add respawn support
https://dev.openwrt.org/ticket/13751 Signed-off-by: John Crispin <blogic@openwrt.org>
Diffstat (limited to 'inittab.c')
-rw-r--r--inittab.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/inittab.c b/inittab.c
index 2ed1395..686d389 100644
--- a/inittab.c
+++ b/inittab.c
@@ -175,6 +175,15 @@ err_out:
regfree(&pat_cmdline);
}
+static void rcrespawn(struct init_action *a)
+{
+ a->tout.cb = respawn;
+ a->respawn = 500;
+
+ a->proc.cb = child_exit;
+ fork_worker(a);
+}
+
static struct init_handler handlers[] = {
{
.name = "sysinit",
@@ -190,6 +199,10 @@ static struct init_handler handlers[] = {
.name = "askconsole",
.cb = askconsole,
.multi = 1,
+ }, {
+ .name = "respawn",
+ .cb = rcrespawn,
+ .multi = 1,
}
};