Warning: this method may break your system so please *do not* use this on any "mission critical" boxen.

For those who dislike bloat, OpenRC is an init system that offers a greatly simplified solution compared to systemd or sysvinit (specifically, sysv-rc) with a much smaller codebase and consequently increased security, stability and reliability.

OpenRC is a dependency based service manager. It provides support for System V init, for booting, changing runlevels, starting and stopping services, and shutting down.

Originally written as a Gentoo project, OpenRC aims at being platform-agnostic. It works equally well on Linux, BSD and Hurd. It supports the traditional init system in Debian in addition to many alternatives. OpenRC is implemented in C in a small, simple and efficient way, making it easy to understand, extend and reuse.

It is already possible to use OpenRC in BunsenLabs in conjunction with sysvinit by installing the systemd-shim and sysvinit-core packages along with the stock jessie (or stretch) openrc package.

However, the latest versions of OpenRC now include the openrc-init binary that can be used as a drop-in replacement for /sbin/init

The advantages of this are that it allows systemd to remain in place so it can be used as a backup PID1 in case anything goes wrong [1] and also that it does not require the un-maintained systemd-shim package.

To take advantage of this method, first install sysvinit (we need some of the installed scripts for OpenRC):

Other options are available for `openrc-shutdown`, see "--help" for details.

[1] boot with systemd again by pressing "e" with the Debian GRUB menu entry highlighted and simply delete the extra init=/sbin/openrc-init parameter and press <Ctrl>+x (at the same time) to boot the modified entry; remeber to modify grub.cfg to make this permanent if needed.

Last edited by Head_on_a_Stick on 2017-10-16 05:40, edited 2 times in total.

#!/sbin/openrc-run# Copyright (c) 2017 The OpenRC Authors.# See the Authors file at the top-level directory of this distribution and# https://github.com/OpenRC/openrc/blob/master/AUTHORS## This file is part of OpenRC. It is subject to the license terms in# the LICENSE file found in the top-level directory of this# distribution and at https://github.com/OpenRC/openrc/blob/master/LICENSE# This file may not be copied, modified, propagated, or distributed# except according to the terms contained in the LICENSE file.

start_pre() { if [ -z "$port" ]; then eerror "${RC_SVCNAME} cannot be started directly. You must create" eerror "symbolic links to it for the ports you want to start" eerror "agetty on and add those to the appropriate runlevels." return 1 fi}

Then symlink that to other agetty.$port files where $port is replaced with the console number (for example tty2), like this:

It may also be worth noting that OpenRC's native process supervision can be replaced with either runit or skarnet.org's small and secure supervision software suite (better known as s6) for an even more minimal setup.