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:10] throgh [Consistent network device naming is not disabled] |
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 ===== | ||
- | <note important> | + | <note important> |
===== Configuration ===== | ===== Configuration ===== | ||
==== 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 173: | 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> | ||
Line 179: | Line 136: | ||
</ | </ | ||
- | <note tip>Make sure what services you was using in systemd to re-enable them in OpenRC: | + | ==== Boot logs ==== |
- | <code bash> | + | |
- | $ ls -ls /etc/systemd/ | + | Open the configuration file <color # |
- | </code> | + | The log files for the entire **rc** process will be stored in <color #0B71B9/#DDF1FF>/ |
- | Sometimes, there are target files such as <color # | + | |
- | </note> | + | |
==== 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 201: | Line 158: | ||
</ | </ | ||
- | ==== NetworkManager settings | + | ==== Keyboard and Keymap |
- | You need to enable | + | To modify |
<code bash> | <code bash> | ||
- | # rc-update add NetworkManager default | + | keymap=" |
</ | </ | ||
- | In order to not change | + | To configure |
- | < | + | < |
- | # Static hostname | + | keymap=" |
- | [keyfile] | + | |
- | hostname=**Votre hostname** | + | |
</ | </ | ||
- | For NetworkManager to work correctly in OpenRC, make sure that <color # | + | After editing |
- | <note important> For security reasons, we have plans to remove [[https:// | + | <code bash> |
+ | # rc-service keymaps restart | ||
+ | </code> | ||
- | ==== Kepmap ==== | + | < |
- | As the hostname, you need to setup the keymap in the file <color # | + | ==== Network settings ==== |
- | < | + | You need to enable the daemon <color # |
- | keymap=" | + | |
+ | < | ||
+ | # rc-update add dhcpcd default | ||
</ | </ | ||
- | If you have an advanced usage of your keymap, you can watch the other functionalities, | ||
+ | |||
+ | ==== Login manager ==== | ||
+ | |||
+ | **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**: | ||
<code bash> | <code bash> | ||
- | # rc-service keymaps restart | + | pacman |
</ | </ | ||
- | < | + | As an example, to use **slim** as the graphical |
+ | <code bash> | ||
+ | DISPLAYMANAGER=" | ||
+ | </code> | ||
- | ==== Login display manager ==== | + | In order for changes to take effect, make sure to enable the xdm daemon, like so: |
+ | <code bash> | ||
+ | # rc-update add xdm default | ||
+ | </ | ||
- | Unlike another distros with OpenRC support, the DM is launched directly. | + | **slim** |
- | For example, with <color # | + | The alternative would be to use **slim** direct. So first make sure to install the package **slim**: |
+ | <code bash> | ||
+ | pacman -S slim | ||
+ | </code> | ||
+ | You can add the service direct at the corresponding runlevel: | ||
<code bash> | <code bash> | ||
- | # rc-update add lightdm | + | # rc-update add slim 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, | ||
+ | |||
===== Adaptation between systemctl and rc-update ===== | ===== Adaptation between systemctl and rc-update ===== | ||
Line 257: | Line 244: | ||
</ | </ | ||
- | And delete | + | You also can delete |
<code bash> | <code bash> | ||
Line 271: | 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 313: | 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 322: | 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 330: | 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 | ||
+ | </code> | ||
+ | |||
+ | Afterwards you should be able to use the command as follows: | ||
+ | |||
+ | <code bash> | ||
+ | doas poweroff | ||
+ | </code> | ||
- | ===== Acknowledgement ===== | ||
- | This wiki article is based on **[[https:// |