#!/bin/sh # /etc/runit/1 - system one-time tasks # # This file runs OpenRC up to the "boot" runlevel to get your system into a # reasonable state. If you need to add system-specific one-shot tasks, consider # using OpenRC's existing /etc/local.d/ facility via the boot runlevel instead # of editing this file, as it will be overwritten on upgrades. SVDIR=/etc/service PATH=/usr/sbin:/sbin:/usr/bin:/bin export PATH # Assume openrc will put the system into a sane state RUNLEVEL=S openrc sysinit RUNLEVEL=S openrc boot # Runit expects $SVDIR to be mutable, which isn't good to do in /etc/ for a # number of good reasons, but is hard to change due to compatibility reasons. # We try here to symlink the $SVDIR/**/supervise/ dirs to /run/ so that the # system still works if the filesystem $SVDIR's on is (or becomes) readonly. # This is a hacky solution, and the right one would be to put SVDIR in /run/. runtime_dir="/run/runit" # This may fail if /run/ also isn't writable, but that's not a fatal error on # our part. install -m 0755 -d "${runtime_dir}" rescue_shell() { install -m 0100 /dev/null "${runtime_dir}"/reboot cat <