[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.
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
howtos:general_admin:openrc [2018/11/07 09:46 (UTC)] – [On reboot] change backup file name for consistency aaditya | howtos:general_admin:openrc [2020/04/12 15:08 (UTC)] – [Shutdown/reboot] add info about wrappers aaditya | ||
---|---|---|---|
Line 4: | Line 4: | ||
OpenRC is a dependency based service management system. It works with the system provided init program, normally /// | OpenRC is a dependency based service management system. It works with the system provided init program, normally /// | ||
- | ====== Features | + | ===== Features ===== |
OpenRC provides a number of features like hardware initiated initscript run and cgroups support, without requiring large layout changes. | OpenRC provides a number of features like hardware initiated initscript run and cgroups support, without requiring large layout changes. | ||
Line 10: | Line 10: | ||
====== Installation ====== | ====== Installation ====== | ||
- | ===== Pre installation ===== | + | Two [[slackware: |
- | The /etc/init.d directory (a symlink to /// | + | ===== Post installation ===== |
- | # mv /etc/init.d / | + | |
- | ===== Installing ===== | + | After installation, |
- | Two [[slackware: | + | === Setup the agetty |
- | ===== Post installation ===== | + | # main tty |
+ | ln -s / | ||
+ | / | ||
+ | |||
+ | cp / | ||
+ | echo ' | ||
+ | |||
+ | # additional ttys | ||
+ | for i in {2..6}; do | ||
+ | ln -s / | ||
+ | / | ||
+ | done | ||
+ | |||
+ | # serial tty (for servers) | ||
+ | ln -s / | ||
+ | / | ||
+ | |||
+ | cp / | ||
+ | echo ' | ||
+ | |||
+ | === Update boot parameters | ||
+ | |||
+ | Add the following to your boot parameters (via /// | ||
+ | init=/ | ||
+ | |||
+ | Regenerate boot configuration ('lilo -v' or ' | ||
- | After installing, /// | + | === Enable boot logging === |
- | # cp / | + | |
- | # mv / | + | |
- | The main configuration file for OpenRC is /// | + | The main configuration file for OpenRC is ///etc/openrc/rc.conf//, and contains various options. |
A common option that could be changed is to enable boot logging by setting '' | A common option that could be changed is to enable boot logging by setting '' | ||
Line 31: | Line 53: | ||
===== On reboot ===== | ===== 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 /// | It may show a warning about deprecated support for /// | ||
Line 56: | Line 78: | ||
# rc-update add sysklogd default | # rc-update add sysklogd default | ||
# rc-update add dcron default | # rc-update add dcron default | ||
- | # rc-update add alsasound | + | # rc-update add alsasound |
# rc-update add consolekit default | # rc-update add consolekit default | ||
# rc-update add sshd default | # rc-update add sshd default | ||
Line 82: | Line 104: | ||
If using wifi with laptops the **NetworkManager** or **wicd** service could be enabled. The combination of dhcpcd and wpa_supplicant (along with a frontend like wpa_gui or wpa_cli) could also be used as a lightweight alternative. | If using wifi with laptops the **NetworkManager** or **wicd** service could be enabled. The combination of dhcpcd and wpa_supplicant (along with a frontend like wpa_gui or wpa_cli) could also be used as a lightweight alternative. | ||
- | A static network can be configured by editing /// | + | A static network can be configured by editing ///etc/openrc/ |
=== Display manager === | === Display manager === | ||
- | To boot to a graphical display manager, /// | + | To boot to a graphical display manager, ///etc/openrc/ |
# rc-update add xdm default | # rc-update add xdm default | ||
Line 116: | Line 138: | ||
====== Configuration ====== | ====== Configuration ====== | ||
- | OpenRC services are present in the /// | + | OpenRC services are present in the ///etc/openrc/init.d// folder, and corresponding configuration files are present in ///etc/openrc/conf.d// |
Some common configuration files include: | Some common configuration files include: | ||
- | / | + | /etc/openrc/ |
- | / | + | /etc/openrc/ |
- | / | + | /etc/openrc/ |
- | ===== Services | + | ===== Service management |
Services can be started/ | Services can be started/ | ||
Line 134: | Line 156: | ||
# rc-service sshd start | # rc-service sshd start | ||
- | ====== openrc-init ====== | + | |
+ | ===== Shutdown/ | ||
- | Since version | + | To shutdown or reboot, one will need to use **openrc-shutdown**. To shutdown from a desktop environment using ConsoleKit2, check out this [[https://github.com/ConsoleKit2/ConsoleKit2/ |
- | This allows switching between OpenRC and other init systems, for example sysvinit, just by changing boot parameters. | + | ==== Note ==== |
- | To use it, | + | The **ck-system-stop** and **ck-system-restart** files in the [[https:// |
- | === Revert inittab changes done === | + | ====== Troubleshooting ====== |
- | cp / | + | At the moment only a subset of the included |
- | mv / | + | |
- | + | ||
- | === Setup the agetty | + | |
- | # main tty | + | If some service does not work, try the system provided one in /// |
- | ln -s /etc/init.d/ | + | |
- | /sbin/rc-update add agetty.tty1 default | + | |
- | + | ||
- | cp /etc/conf.d/agetty | + | |
- | echo ' | + | |
- | + | ||
- | # additional ttys | + | |
- | for i in {2..6}; do | + | |
- | ln -s / | + | |
- | / | + | |
- | done | + | |
- | + | ||
- | # serial tty (for servers) | + | |
- | ln -s / | + | |
- | / | + | |
- | + | ||
- | cp / | + | |
- | echo ' | + | |
- | === Update boot parameters | + | ==== mysqld ==== |
- | Add the following to your boot parameters (via ///etc/lilo.conf// for lilo or /// | + | Try adding |
- | init=/ | + | |
- | === Shutdown/reboot === | + | [mysqld] |
+ | user = mysql | ||
+ | basedir | ||
+ | datadir | ||
+ | pid-file | ||
+ | socket | ||
- | To shutdown | + | ==== Dealing with crashed services ==== |
+ | |||
+ | Sometimes openrc reports a service' | ||
+ | |||
+ | If one tries to start a crashed service, `rc-service` reports: | ||
+ | |||
+ | * WARNING: < | ||
+ | |||
+ | So one tries to stop it before starting again. | ||
+ | |||
+ | However in some situations, the service does not stop. This leads to a deadlock where one can neither stop the service nor start it. For such cases: | ||
+ | |||
+ | # rc-service < | ||
+ | | ||
+ | |||
+ | **zap** resets the service state, allowing us to start it again. | ||
+ | |||
+ | ===== openrc-init ===== | ||
+ | |||
+ | Since version | ||
+ | |||
+ | This allows switching between OpenRC and other init systems, for example sysvinit, just by changing boot parameters. | ||
For more info, check out the [[https:// | For more info, check out the [[https:// | ||
- | ====== Migrating from /etc/init.d to / | + | ===== Migrating from /etc/init.d to / |
- | OpenRC 0.39+, as // | + | OpenRC 0.39+, as shipped via SBo, changes the service and configuration directory to /// |
This is being done to maintain greater compatibility with a vanilla Slackware install. | This is being done to maintain greater compatibility with a vanilla Slackware install. | ||
Line 235: | Line 262: | ||
fi | fi | ||
done | done | ||
+ | # main config file | ||
+ | diff -Nupr / | ||
| | ||
# check local.d changes | # check local.d changes | ||
Line 266: | Line 295: | ||
mv / | mv / | ||
- | |||
- | ====== Troubleshooting ====== | ||
- | |||
- | At the moment only a subset of the included services have been tested, so some of them may not run correctly. | ||
- | |||
- | If some service does not work, try the system provided one in /// | ||
- | |||
- | ==== mysqld ==== | ||
- | |||
- | Try adding the following lines to /// | ||
- | |||
- | [mysqld] | ||
- | user = mysql | ||
- | basedir = /usr | ||
- | datadir = / | ||
- | pid-file = / | ||
- | socket = / | ||
- | |||
- | ==== Dealing with crashed services ==== | ||
- | |||
- | Sometimes openrc reports a service' | ||
- | |||
- | If one tries to start a crashed service, `rc-service` reports: | ||
- | |||
- | * WARNING: < | ||
- | |||
- | So one tries to stop it before starting again. | ||
- | |||
- | However in some situations, the service does not stop. This leads to a deadlock where one can neither stop the service nor start it. For such cases: | ||
- | |||
- | # rc-service < | ||
- | * Manually resetting < | ||
- | |||
- | **zap** resets the service state, allowing us to start it again. | ||
- | |||
- | ==== Errors while booting ==== | ||
- | |||
- | After installing or updating the **openrc-services** packages, one may get errors like: | ||
- | |||
- | * checkpath: owner `netdata: | ||
- | |||
- | This is because **openrc-services** contains services for some packages not found in the base Slackware install, but present on SBo. | ||
- | |||
- | These usually go away on their own after the openrc cache is updated. | ||
====== See Also ====== | ====== See Also ====== |