Enjoy Slackware 15.0!
Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
howtos:general_admin:openrc [2018/10/08 03:48 (UTC)] aaditya [openrc-init] clarify ttys |
howtos:general_admin:openrc [2020/04/12 15:08 (UTC)] aaditya [Shutdown/reboot] add info about wrappers |
||
---|---|---|---|
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 /// | ||
- | # cp /etc/mtab /etc/mtab.bak | + | # cp /etc/mtab /etc/mtab.bkp |
# ln -snf / | # ln -snf / | ||
| | ||
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 ====== | ||
- | |||
- | Since version **0.25**, openrc provides // | ||
- | |||
- | To use it, | ||
- | |||
- | * Revert inittab changes done | ||
- | |||
- | cp / | ||
- | mv / | ||
| | ||
- | * Setup the agetty services | + | ===== Shutdown/ |
- | # main tty | + | To shutdown or reboot, one will need to use **openrc-shutdown**. To shutdown from a desktop environment using ConsoleKit2, |
- | ln -s /etc/init.d/agetty | + | |
- | | + | |
- | + | ||
- | cp / | + | |
- | echo ' | + | |
- | + | ||
- | # additional ttys | + | |
- | for i in {2..6}; do | + | |
- | ln -s / | + | |
- | / | + | |
- | done | + | |
- | + | ||
- | # serial tty for servers | + | |
- | ln -s / | + | |
- | / | + | |
- | + | ||
- | cp / | + | |
- | echo ' | + | |
- | * Add the following to your boot parameters: | + | ==== Note ==== |
- | init=/ | + | |
- | Note- To shutdown or reboot, one will need to use **openrc-shutdown**. | + | The **ck-system-stop** and **ck-system-restart** files in the [[https://github.com/ConsoleKit2/ConsoleKit2/ |
- | + | ||
- | For more info, check out the [[https://wiki.gentoo.org/wiki/OpenRC# | + | |
====== Troubleshooting ====== | ====== Troubleshooting ====== | ||
Line 208: | Line 199: | ||
**zap** resets the service state, allowing us to start it again. | **zap** resets the service state, allowing us to start it again. | ||
- | ==== Errors while booting | + | ===== openrc-init |
+ | |||
+ | Since version **0.25**, openrc provides // | ||
+ | |||
+ | This allows switching between OpenRC and other init systems, for example sysvinit, just by changing boot parameters. | ||
+ | |||
+ | For more info, check out the [[https:// | ||
+ | |||
+ | ===== Migrating from /etc/init.d to / | ||
+ | |||
+ | 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. | ||
+ | |||
+ | Existing services will need to be migrated, details below on how it can be done. | ||
+ | |||
+ | === 1. Install openrc-0.39.2 and openrc-services-20181107 === | ||
+ | |||
+ | These packages ship the configuration and service files in /// | ||
+ | |||
+ | === 2. Migrate existing services === | ||
+ | |||
+ | This involves 4 steps: | ||
+ | |||
+ | # migrate existing services | ||
+ | for service in / | ||
+ | svcname=$(basename " | ||
+ | if [ ! -e "/ | ||
+ | if [ -f "/ | ||
+ | cp -v "/ | ||
+ | elif [ -L "/ | ||
+ | # check if symlink is of a service | ||
+ | service_target=$(readlink -f " | ||
+ | service_target_name=$(basename " | ||
+ | if [ $(dirname " | ||
+ | ln -sv "/ | ||
+ | fi | ||
+ | fi | ||
+ | fi | ||
+ | done | ||
+ | |||
+ | # enable existing services | ||
+ | for runlevel in / | ||
+ | for service in ${runlevel}/ | ||
+ | svcname=$(basename " | ||
+ | rvlname=$(basename " | ||
+ | if [ ! -e / | ||
+ | ln -sv / | ||
+ | fi | ||
+ | done | ||
+ | done | ||
+ | |||
+ | # check config changes | ||
+ | for file in / | ||
+ | filename=$(basename " | ||
+ | extension=" | ||
+ | if [ " | ||
+ | continue | ||
+ | fi | ||
+ | if [ -e "/ | ||
+ | diff -Nupr "/ | ||
+ | fi | ||
+ | done | ||
+ | # main config file | ||
+ | diff -Nupr / | ||
+ | |||
+ | # check local.d changes | ||
+ | for file in / | ||
+ | filename=$(basename " | ||
+ | if [ ! -e "/ | ||
+ | cp -v "/ | ||
+ | elif [ -e "/ | ||
+ | # show changes | ||
+ | diff -Nupr "/ | ||
+ | fi | ||
+ | done | ||
+ | |||
+ | Config changes found above can be updated by hand or copy pasted in new location. | ||
+ | |||
+ | === 3. Check and reboot === | ||
+ | |||
+ | Verify if '' | ||
+ | |||
+ | Reboot and check whether things are working expected, make changes as necessary. | ||
- | After installing | + | The old files and folders can be renamed (or removed). |
- | * checkpath: owner `netdata: | + | mv /etc/init.d / |
+ | mv /etc/conf.d / | ||
+ | mv / | ||
+ | mv / | ||
+ | mv / | ||
- | This is because **openrc-services** contains services for some packages not found in the base Slackware | + | Finally, any changes done to the default |
- | These usually go away on their own after the openrc cache is updated. | + | mv /etc/init.d-bkp /etc/init.d |
====== See Also ====== | ====== See Also ====== |