[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/09/30 10:38 (UTC)] – [openrc-init] aaditya | howtos:general_admin:openrc [2018/11/29 18:53 (UTC)] – [openrc-init] add ingo to reload boot config aaditya | ||
---|---|---|---|
Line 2: | Line 2: | ||
====== OpenRC ====== | ====== OpenRC ====== | ||
- | OpenRC is a dependency based init system | + | OpenRC is a dependency based service management |
====== Features ====== | ====== Features ====== | ||
- | OpenRC provides a number of features | + | OpenRC provides a number of features like hardware initiated initscript run and cgroups support, without requiring large layout changes. |
====== Installation ====== | ====== Installation ====== | ||
Line 34: | Line 34: | ||
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 136: | Line 136: | ||
====== openrc-init ====== | ====== openrc-init ====== | ||
- | Since version **0.25**, openrc provides // | + | Since version **0.25**, openrc provides // |
+ | |||
+ | This allows switching between OpenRC and other init systems, for example sysvinit, just by changing boot parameters. | ||
To use it, | To use it, | ||
- | * Revert inittab changes done | + | === Revert inittab changes done === |
- | cp / | + | cp / |
mv / | mv / | ||
| | ||
- | * Setup the agetty services | + | === Setup the agetty services |
+ | # main tty | ||
+ | ln -s / | ||
+ | / | ||
+ | | ||
+ | cp / | ||
+ | echo ' | ||
+ | | ||
+ | # additional ttys | ||
+ | for i in {2..6}; do | ||
+ | ln -s / | ||
+ | / | ||
+ | done | ||
+ | | ||
+ | # serial tty (for servers) | ||
ln -s / | ln -s / | ||
/ | / | ||
Line 152: | Line 168: | ||
cp / | cp / | ||
echo ' | echo ' | ||
+ | |||
+ | === Update boot parameters === | ||
+ | |||
+ | Add the following to your boot parameters (via /// | ||
+ | init=/ | ||
+ | |||
+ | Regenerate boot configuration ('lilo -v' or ' | ||
+ | |||
+ | === Shutdown/ | ||
+ | |||
+ | To shutdown or reboot, one will need to use **openrc-shutdown**. To shutdown from a desktop environment using ConsoleKit2, | ||
+ | |||
+ | For more info, check out the [[https:// | ||
+ | |||
+ | ====== Migrating from /etc/init.d to / | ||
+ | |||
+ | OpenRC 0.39+, as // | ||
+ | |||
+ | 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 | ||
| | ||
- | for i in {1..6}; do | + | |
- | | + | |
- | | + | for service in ${runlevel}/*; do |
+ | | ||
+ | rvlname=$(basename " | ||
+ | if [ ! -e /etc/ | ||
+ | ln -sv /etc/openrc/init.d/${svcname} /etc/ | ||
+ | fi | ||
+ | done | ||
done | done | ||
| | ||
- | | + | |
- | echo ' | + | 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 | ||
- | * Add the following to your boot parameters: | + | Config changes found above can be updated by hand or copy pasted in new location. |
- | init=/ | + | |
- | Note- To shutdown or reboot, one will need to use **openrc-shutdown**. | + | === 3. Check and reboot === |
- | For more info, check out the [[https://wiki.gentoo.org/wiki/OpenRC#openrc-init|Gentoo wiki]]. | + | Verify if '' |
+ | |||
+ | Reboot and check whether things are working expected, make changes as necessary. | ||
+ | |||
+ | The old files and folders can be renamed (or removed). | ||
+ | |||
+ | mv /etc/init.d /etc/init.d-openrc-bkp | ||
+ | mv /etc/conf.d / | ||
+ | mv / | ||
+ | mv / | ||
+ | mv / | ||
+ | |||
+ | Finally, any changes done to the default Slackware system can be reverted: | ||
+ | |||
+ | mv / | ||
====== Troubleshooting ====== | ====== Troubleshooting ====== | ||
Line 205: | Line 307: | ||
==== Errors while booting ==== | ==== Errors while booting ==== | ||
- | After installing or updating the **openrc-services** packages, | + | After installing or updating the **openrc-services** packages, |
* checkpath: owner `netdata: | * checkpath: owner `netdata: |