Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
en:system:init_systems:openrc [2022/10/24 15:20] throgh [The system can't shutdown correctly] |
en:system:init_systems:openrc [2025/03/13 01:05] (current) throgh [The system can't shutdown correctly] |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ?!(WIP)!? | ||
| - | |||
| ====== OpenRC ====== | ====== OpenRC ====== | ||
| - | OpenRC is a init system for Operational Systems GNU/Linux, GNU/Hurd and Unix, compatible with [[https:// | ||
| - | OpenRC | + | OpenRC |
| - | In 2010 OpenRC was retained by the developers | + | OpenRC emerged at the end of 2007, ((for more details go to: [[https:// |
| + | |||
| + | In 2010, OpenRC was transferred back to the development | ||
| + | |||
| + | In 2013, the OpenRC team became independent from Gentoo GNU/Linux again and changed the primary development to <color # | ||
| - | In 2013, the OpenRC team became independent from Gentoo GNU/Linux again and changed the primary development to the <color # | ||
| ===== Features ===== | ===== Features ===== | ||
| + | |||
| OpenRC provides a number of interesting features: | OpenRC provides a number of interesting features: | ||
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | ===== Configuration ===== | ||
| - | Configuring OpenRC is a simple task, this article offers some steps to optimize the use of this initialization system. | ||
| - | ==== Boot logs ==== | ||
| - | Open the configuration file <color # | ||
| - | ==== Hostname ==== | ||
| - | To add or edit a host name, edit or create the file <color # | ||
| - | <code bash> | ||
| - | hostname=" | ||
| - | </ | ||
| - | ==== Keyboard ==== | ||
| - | Modify the key map for use in the **console** edit the file <color # | ||
| - | <code bash> | ||
| - | keymap=" | ||
| - | </ | ||
| - | To configure the keyboard compatible with a **graphic interface** edit the file <color # | ||
| - | <code bash> | ||
| - | keymap=" | ||
| - | </ | ||
| - | After editing the files, run the command: | ||
| - | <code bash> | ||
| - | # rc-service keymaps restart | ||
| - | </ | ||
| - | ==== Login manager ==== | ||
| - | To enable the login manager, edit the <color # | ||
| - | <code bash> | ||
| - | DISPLAYMANAGER=" | ||
| - | </ | ||
| - | Enable the xdm daemon: | ||
| - | <code bash> | ||
| - | # rc-update add xdm default | ||
| - | </ | ||
| - | ==== Kernel modules ==== | ||
| - | For the automatic loading of any module of the <color # | ||
| - | <code bash> | ||
| - | modules=" | ||
| - | </ | ||
| - | This is only necessary after installation of an application or driver, made by the system administrator, | ||
| - | ==== Silent boot ==== | ||
| - | To hide OpenRC messages during system startup, edit the file <color # | ||
| - | <code bash> | ||
| - | --quiet | ||
| - | </ | ||
| - | For more information: | ||
| - | <code bash> | ||
| - | $ openrc -h | ||
| - | </ | ||
| ===== Runlevels ===== | ===== Runlevels ===== | ||
| - | OpenRC, as well as sysvinit and init (BSD), has a concept of task execution levels (Runlevels), | ||
| - | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | + | OpenRC, as well as sysvinit and init (BSD), has a concept of task execution levels (i.e., [[https:// |
| + | The <color # | ||
| - | !?(WIP)!?!? | + | <code bash> |
| + | # rc-status | ||
| + | * Caching service dependencies ... [ ok ] | ||
| + | Runlevel: default | ||
| + | | ||
| + | | ||
| + | </ | ||
| - | ====== OpenRC ====== | + | All runlevels are represented as folders in <color # |
| - | Since Hyperbola has announced the [[https:// | + | Calling '' |
| - | ===== What is OpenRC? ===== | + | Managing runlevels |
| - | [[https:// | + | <note important> |
| - | ===== Warning ===== | + | The default startup uses the runlevels <color # |
| - | <note warning>Please read the whole warning</ | + | <note warning>< |
| - | + | ||
| - | <color # | + | |
| ===== Groups ===== | ===== Groups ===== | ||
| - | Before Arch migrated to systemd, users had to be manually added to some groups in order to be able to access the corresponding devices. Read more about [[https:// | + | Users have to be manually added to some groups in order to be able to access the corresponding devices. |
| - | + | One problem is that you would not have any sound on your computer if you did not make sure that your user is in the <color # | |
| - | Make sure your user is on the <color # | + | |
| <code bash> | <code bash> | ||
| - | # gpasswd | + | # usermod |
| </ | </ | ||
| - | Same for video, your games might be laggy otherwise: | + | Same as above for video: your games and other graphics output |
| <code bash> | <code bash> | ||
| - | # gpasswd | + | # usermod |
| </ | </ | ||
| Line 113: | Line 71: | ||
| <code bash> | <code bash> | ||
| - | # gpasswd | + | # usermod |
| </ | </ | ||
| Line 119: | Line 77: | ||
| <code bash> | <code bash> | ||
| - | # gpasswd | + | # usermod |
| </ | </ | ||
| Line 125: | Line 83: | ||
| <code bash> | <code bash> | ||
| - | # gpasswd | + | # usermod |
| </ | </ | ||
| <code bash> | <code bash> | ||
| - | # gpasswd | + | # usermod |
| </ | </ | ||
| Line 135: | Line 93: | ||
| <code bash> | <code bash> | ||
| - | # gpasswd | + | # usermod |
| </ | </ | ||
| - | |||
| - | < | ||
| ===== Migration ===== | ===== Migration ===== | ||
| - | Since OpenRC is included by default and systemd is blacklisted by [[https:// | + | <note important> |
| - | + | ||
| - | <code bash> | + | |
| - | run ' | + | |
| - | run ' | + | |
| - | </ | + | |
| - | + | ||
| - | Running these command(s) adds the service(s) to the specified runlevels. For example on running: | + | |
| - | + | ||
| - | <code bash> | + | |
| - | # rc-update add cronie default | + | |
| - | </ | + | |
| - | + | ||
| - | The cronie service would be added to the default runlevel and would automatically be started at boot. | + | |
| - | + | ||
| - | cronie (for cron) and haveged (for entropy harvesting) are some common services that can be enabled. | + | |
| - | + | ||
| - | Also you need to install [[https:// | + | |
| - | + | ||
| - | <code bash> | + | |
| - | # pacman -S polkit | + | |
| - | </ | + | |
| - | + | ||
| - | <note important> | + | |
| - | + | ||
| - | <note important> | + | |
| ===== Configuration ===== | ===== Configuration ===== | ||
| Line 173: | Line 104: | ||
| ==== Services often required ==== | ==== Services often required ==== | ||
| - | Once you migrate to OpenRC, you might need to add <color # | + | Here with OpenRC, you might need to add services to support |
| - | There is the procedure for [[https:// | + | Here is the procedure for [[https:// |
| <code bash> | <code bash> | ||
| Line 199: | Line 130: | ||
| </ | </ | ||
| - | On each package containing an OpenRC service, you will have have this message : | + | On each package containing an OpenRC service, you will have this message: |
| <code bash> | <code bash> | ||
| ==> rc ' | ==> rc ' | ||
| </ | </ | ||
| + | |||
| + | ==== Boot logs ==== | ||
| + | |||
| + | Open the configuration file <color # | ||
| + | The log files for the entire **rc** process will be stored in <color # | ||
| + | |||
| ==== Hostname ==== | ==== Hostname ==== | ||
| - | OpenRC has its configuration | + | OpenRC has its configuration |
| + | |||
| + | In order to set your hostname, edit <color # | ||
| <code bash> | <code bash> | ||
| - | # nano -w / | + | # nano / |
| </ | </ | ||
| - | And replace | + | And redefine |
| < | < | ||
| Line 218: | Line 157: | ||
| hostname=" | hostname=" | ||
| </ | </ | ||
| + | |||
| + | ==== Keyboard and Keymap ==== | ||
| + | |||
| + | To modify the key map for use in the **console**: | ||
| + | |||
| + | <code bash> | ||
| + | keymap=" | ||
| + | </ | ||
| + | |||
| + | To configure the keyboard for use with a **graphical interface**, | ||
| + | |||
| + | <code bash> | ||
| + | keymap=" | ||
| + | </ | ||
| + | |||
| + | After editing the files, run the command: | ||
| + | |||
| + | <code bash> | ||
| + | # rc-service keymaps restart | ||
| + | </ | ||
| + | |||
| + | < | ||
| ==== Network settings ==== | ==== Network settings ==== | ||
| Line 227: | Line 188: | ||
| </ | </ | ||
| - | ==== Kepmap ==== | ||
| - | As the hostname, you need to setup the keymap in the file <color # | ||
| - | < | + | ==== Login manager ==== |
| - | keymap=" | + | |
| + | **xorg-xdm** | ||
| + | |||
| + | To enable the login manager, edit <color # | ||
| + | |||
| + | If that file does not already exist, then first make sure to install the package **xorg-xdm**: | ||
| + | < | ||
| + | pacman -S xorg-xdm | ||
| </ | </ | ||
| - | If you have an advanced usage of your keymap, you can watch the other functionalities, | + | As an example, to use **slim** as the graphical login manager (// |
| + | <code bash> | ||
| + | DISPLAYMANAGER=" | ||
| + | </code> | ||
| + | In order for changes to take effect, make sure to enable the xdm daemon, like so: | ||
| <code bash> | <code bash> | ||
| - | # rc-service keymaps restart | + | # rc-update add xdm default |
| </ | </ | ||
| - | < | + | **slim** |
| - | ==== Login display manager ==== | + | The alternative would be to use **slim** direct. So first make sure to install the package **slim**: |
| + | <code bash> | ||
| + | pacman -S slim | ||
| + | </ | ||
| - | Unlike another distros with OpenRC support, | + | You can add the service direct at the corresponding runlevel: |
| + | <code bash> | ||
| + | # rc-update add slim default | ||
| + | </ | ||
| - | For example, with <color #620BB9/#EEDDFF>wdm</ | + | ==== Kernel modules ==== |
| + | |||
| + | For the automatic loading of any module of the <color #0BB928/#DDFFE3>Kernel Linux-Libre</ | ||
| <code bash> | <code bash> | ||
| - | # rc-update add wdm default | + | modules=" |
| </ | </ | ||
| + | |||
| + | This is only necessary after installation of an application or driver, made by the system administrator, | ||
| + | |||
| ===== Adaptation between systemctl and rc-update ===== | ===== Adaptation between systemctl and rc-update ===== | ||
| Line 263: | Line 244: | ||
| </ | </ | ||
| - | And delete | + | You also can delete |
| <code bash> | <code bash> | ||
| Line 277: | Line 258: | ||
| </ | </ | ||
| - | ==== Stop/ | + | ==== Stop / Start / Restart a service ==== |
| To restart a service, you need to use <color # | To restart a service, you need to use <color # | ||
| Line 319: | Line 300: | ||
| ==== Swap isn't enabled ==== | ==== Swap isn't enabled ==== | ||
| - | Systemd used to mount the swap automatically, | + | You need to manually add the swap partition |
| <code bash> | <code bash> | ||
| Line 328: | Line 309: | ||
| ==== tmpfs isn't present ==== | ==== tmpfs isn't present ==== | ||
| - | As the swap, systemd automatically mounts the tmpfs. | + | Add it in <color # |
| <code bash> | <code bash> | ||
| Line 336: | Line 317: | ||
| ==== The system can't shutdown correctly ==== | ==== The system can't shutdown correctly ==== | ||
| - | Begin with OpenRC 0.28 SysVinit is replaced with openrc-init, | + | Please add your user to the group <color # |
| + | |||
| + | <code bash> | ||
| + | # usermod -aG power <your-user> | ||
| + | </ | ||
| + | |||
| + | Afterwards | ||
| + | |||
| + | <code bash> | ||
| + | doas poweroff | ||
| + | </code> | ||
| - | ===== Acknowledgement ===== | ||
| - | This wiki article is based on **[[https:// | ||