8.84. OpenRC-0.63

The OpenRC package contains programs for controlling the startup, running, and shutdown of the system.

Approximate build time: 0.1 SBU
Required disk space: 13 MB

8.84.1. Installation of OpenRC

Fix a script to allow a normal installation:

sed -i '/set -u/d' tools/meson_final.sh

Prepare OpenRC for compilation:

mkdir build
cd    build

meson setup --prefix=/usr       \
            --buildtype=release \
            -D pam=false ..

The meaning of the configure options:

-D pam=false

This disables needing Linux-PAM for the build, since it is not installed yet.

Compile the package:

ninja

To run the tests, issue:

ninja test

Install the package:

ninja install

OpenRC provides init and other programs of its own. However, the shorthands for them aren't created. Create the symlinks:

for i in {init,shutdown}; do
  ln -sv openrc-$i /sbin/$i
done

cat > /sbin/poweroff << "EOF"
#!/bin/sh
/sbin/shutdown --poweroff now
EOF

cat > /sbin/reboot << "EOF"
#!/bin/sh
/sbin/shutdown --reboot now
EOF

chmod 755 /sbin/poweroff /sbin/reboot

8.84.2. Contents of OpenRC

Installed programs: rc-status, init (link to openrc-init), openrc, openrc-init, openrc-run, openrc-shutdown, poweroff, rc-service, rc-sstat, rc-update, reboot, shutdown (link to openrc-shutdown), start-stop-daemon, and supervise-daemon
Installed libraries: libeinfo.so and librc.so
Installed directories: /etc/conf.d, /etc/init.d, /etc/local.d, /etc/runlevels, /etc/sysctl.d, /usr/libexec/rc, and /usr/share/openrc

Short Descriptions

rc-status

Gives the status of a service

init

Is the first process to be started when the kernel has initialized the hardware; it takes over the boot process and starts all the services; symlink to openrc-init

openrc

starts and stops services on a given runlevel

openrc-init

Gets called from init and starts every service as needed

openrc-run

Allows using shell commands in a service file

openrc-shutdown

Brings the system down in a secure way, signaling all processes and notifying all logged-in users

poweroff

Calls openrc-shutdown with --poweroff, stopping all services and processes before shutting down the system

rc-service

Runs a given service after locating it

rc-sstat

Gives the status of the most crucial services, followed by normal services

rc-update

Adds and removes services on a runlevel

reboot

Calls openrc-shutdown with --reboot, stopping all services and processes before telling the system to reboot

shutdown

Is a symlink to openrc-shutdown

start-stop-daemon

Starts or stops a daemon in a service file

supervise-daemon

Supervises a daemon in a service file

libeinfo

Contains functions for outputting colored messages

librc

Provides the core OpenRC functions