[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.

Welcome to the Slackware Documentation Project

This is an old revision of the document!


OpenRC

OpenRC is a dependency based init system that works with the system provided init program, normally /sbin/init (which is svsvinit in Slackware). It is not a replacement for /sbin/init.

Features

OpenRC provides a number of features touted as innovative by recent init systems like systemd or upstart, such as hardware initiated initscript run or cgroups support, without requiring large layout changes to accommodate radically different designs and dependencies.

Installation

Pre installation

The /etc/init.d directory would need to be moved out:

# mv /etc/init.d /etc/init.d.bak

Installing

Two Slackbuilds are available, openrc, which contains the OpenRC init system, and openrc-services, which contains various services for use with OpenRC.

Post installation

After installing, /etc/inittab would need to be replaced. The old one can be backed up:

# cp /etc/inittab /etc/inittab.sysvinit
# mv /etc/inittab.new /etc/inittab

The main configuration file for OpenRC is /etc/rc.conf, and contains various options.

A common option that could be changed is to enable boot logging by setting rc_logger=“YES”, this way any errors encountered via booting could be logged and examined later.

On reboot

After installing openrc and openrc-services, on rebooting one is booted to a command line with only the bare minimum of services enabled.

It may show a warning about deprecated support for /etc/mtab as a file, and how to correct it, ie:

# ln -snf /proc/self/mounts /etc/mtab

It may also complain about missing /etc/sysctl.conf file which can be created as:

# touch /etc/sysctl.conf

Enabling some services

Some common services could be enabled as:

# rc-update add udev default
# rc-update add dbus default
# rc-update add sysklogd default
# rc-update add dcron default
# rc-update add alsasound default
# rc-update add consolekit default

Enabled services can be queried with:

$ rc-status

All services present can be queried with:

# rc-update -v

Network

If you are using ethernet via DHCP, the dhcpcd service could be enabled:

# rc-update add dhcpcd default

If using wifi with laptops one could enable the NetworkManager or wicd service.

A static network could be configured by editing /etc/conf.d/network.

Display manager

To boot to a graphical display manager, /etc/conf.d/xdm can be edited to specify the display manager, and the xdm service could be enabled:

# rc-update add xdm default

If you are on a laptop, the acpid service could be enabled as well.

Configuration

OpenRC services are present in the /etc/init.d folder, and corresponding configuration files are present in /etc/conf.d

Some common configuration files include:

/etc/conf.d/modules    # modules to be loaded at boot
/etc/conf.d/hostname   # hostname of the system
/etc/conf.d/keymaps    # console keymap

Services

Services can be started/stopped/restarted as:

# rc-service <service> <action>

For example,

# rc-service sshd start

Services can be enabled as:

# rc-service add <service> <runlevel>

For example,

# rc-service add sshd default

They can be disabled as:

# rc-service del <service> <runlevel>

Troubleshooting

At the moment only a subset of the included services have been tested, so some of them may not run correctly.

Some of the tested services which do not run correctly include mysqld and httpd. For these the system provided services in /etc/rc.d could be used.

See Also

Sources

* Originally written by Aaditya

 howtos:general_admin:openrc ()