#!/bin/sh # /etc/runit/2 - main-sequence service monitoring # # This script chainloads into runsvdir at $SVDIR (/etc/service by default). LC_ALL="C.UTF-8" PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/sbin:/usr/bin:/bin" SVDIR="/etc/service" export LC_ALL PATH SVDIR # Try to avoid supervised services flooding the active tty with their stdout by # redirecting it elsewhere. The right thing to do instead of relying on this is # configuring syslog or svlogd in each service so their stdout never ends up # here in the first place, but doing so isn't always practical. for console_device in /dev/tty12 /dev/ttyS1 /dev/kmsg; do if [ -c "${console_device}" ]; then # shellcheck disable=SC2094 exec <>"${console_device}" >"${console_device}" 2>"${console_device}" break fi done exec runsvdir -P "${SVDIR:-/etc/service}"