From bc5c44dd049bad3b007be48b3f8d90886d63c105 Mon Sep 17 00:00:00 2001 From: System administrator Date: Mon, 29 May 2017 13:26:10 +0200 Subject: Initial commit --- images/runit-edge/runit/run | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 images/runit-edge/runit/run (limited to 'images/runit-edge/runit') diff --git a/images/runit-edge/runit/run b/images/runit-edge/runit/run new file mode 100644 index 0000000..c3861c2 --- /dev/null +++ b/images/runit-edge/runit/run @@ -0,0 +1,17 @@ +#!/bin/sh + +echo "Found services:" +find /etc/service -mindepth 1 -maxdepth 1 + +/sbin/runsvdir /etc/service & +runsvdir_pid=$! +echo "Started runit as $runsvdir_pid" + +runit_stop() { + echo "Stopping runit" + # "If runsvdir receives HUP, it sends TERM to each runsv process" + kill -HUP $runsvdir_pid +} + +trap "runit_stop" SIGTERM +wait -- cgit v1.2.3