summaryrefslogtreecommitdiff
path: root/images/runit-edge/runit/run
blob: c3861c2003475c01a31915ad65457553c43d0fa2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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