The officially official Devuan Forum!

You are not logged in.

#1 2018-05-16 08:59:47

Geoff 42
Member
Registered: 2016-12-15
Posts: 461  

Converting to OpenRC

As OpenRC is now available in ASCII, I thought that I should try it on my laptop, which has arrived at ASCII via Debian Jessie and Devuan Jessie.

I have been running runit as a process supervisor, which I chose to roll back before installing OpenRC. I report that in my thread on runit.
https://dev1galaxy.org/viewtopic.php?id=1748

The next thing was to install Openrc. Synaptic wanted to remove bum and sysv-rc and also install libeinfo1 and librc1. The installation proceeds normally producing the following warning :-

**********************************************************************
*** WARNING: if you are replacing sysv-rc by OpenRC, then you must ***
*** reboot immediately using the following command:                ***
for file in /etc/rc0.d/K*; do s=`basename $(readlink "$file")` ; /etc/init.d/$s stop; done
**********************************************************************

I had seen a mesage on DNG that the above command hangs the system and that you should just reboot,
so I did just reboot and everything came back up normally.

https://lists.dyne.org/lurker/message/2 … d7.en.html

The next qustion was "is openrc running?" Running ps uaxf shows :-

root         1  1.6  0.0  15816  1884 ?        Ss   15:59   0:00 init [2]

Switching to the console with <CTRL><ALT><F1> does not show any messages referring to openrc.

Checking with synaptic, openrc is installed ;-)

There are a couple of commands to check how things are running. You can run rc-status as yourself while rc-update show needs to be run as root. These seem to show that the services are running under openrc. It is also possible to check a specific service with, e.g. :

/etc/init.d/lxdm status
[ ok ] lxdm is running.

There is some documentation at :-

https://wiki.gentoo.org/wiki/OpenRC

I am hoping to try using runit under OpenRC

https://wiki.gentoo.org/wiki/Runit#runitintegration

Geoff

Last edited by Geoff 42 (2018-05-16 09:00:49)

Offline

#2 2018-05-18 09:11:03

Geoff 42
Member
Registered: 2016-12-15
Posts: 461  

Re: Converting to OpenRC

As well as the very good Gentoo docs, there is also a rich source of documentation and example stuff on the OpenRC GitHub :-

https://github.com/OpenRC/openrc

This includes a user guide as well as various scripts.

Geoff

Offline

#3 2018-05-18 10:08:05

Geoff 42
Member
Registered: 2016-12-15
Posts: 461  

Re: Converting to OpenRC

The version of OpenRC in ASCII is 0.23. In this version it still runs our old friend /sbin/init, which still refers to /etc/inittab which appears to be unaltered. When inittab sets the runlevel it uses /etc/init.d/rc (& rcS). It is here that OpenRC is used, as rc & rcS are replaced when OpenRC is installed. /etc/init.d/rc runs /sbin/openrc which then runs the services defined for that level and then stops. It therefore does not show on a ps listing.

You can see some of the housekeeping in /run/openrc.

Geoff

Offline

#4 2018-05-18 11:43:38

elc79
Member
Registered: 2018-05-10
Posts: 2  

Re: Converting to OpenRC

If you are talking about running openrc-init instead init your choices is to migrate to unstable, or build the last version from Gentoo sources. Debian based distros are not the best choice to run OpenRC, the best and more easy options are some Arch based distros like Parabola, Hyperbola, or Artix.

Offline

#5 2018-05-18 18:46:17

Geoff 42
Member
Registered: 2016-12-15
Posts: 461  

Re: Converting to OpenRC

I am just keen to see how well the OpenRC that is shipped with ASCII works and it seems that if you don't want to do anything too odd, that it just works! In fact it works so well that you have to look quite closely to check if it is actually running!

I have tried editing /etc/rc.conf to set rc_logger="YES" in order to see what it was logging. Originally I also set rc_verbose="YES", but that put out too much info for me, but with that turned off the logging was quite reasonable.

Geoff

Last edited by Geoff 42 (2018-05-18 18:53:35)

Offline

#6 2018-05-18 19:51:14

mlsmith
Member
Registered: 2016-11-25
Posts: 60  

Re: Converting to OpenRC

Thanks for testing that Geoff! I'm interested in using OpenRC and runit as well.

Offline

#7 2018-05-19 16:20:42

Geoff 42
Member
Registered: 2016-12-15
Posts: 461  

Re: Converting to OpenRC

I am reporting on my efforts to integrate Runit with OpenRC in a separate thread under DIY :-

https://dev1galaxy.org/viewtopic.php?id=2078

Geoff

Offline

#8 2018-05-28 14:10:50

Geoff 42
Member
Registered: 2016-12-15
Posts: 461  

Re: Converting to OpenRC

Also in the above mentioned thread on integrating Runit with OpenRC, I have also looked at OpenRC's built-in supervise-daemon.

Geoff

Offline

#9 2018-05-30 14:23:36

Geoff 42
Member
Registered: 2016-12-15
Posts: 461  

Re: Converting to OpenRC

Logging

I now have both my machines running OpenRC and have logging turned on in /etc/rc.conf with rc_loger="YES". As I have been playing around with OpenRC I have been looking at /var/log/rc.log and it is quite interesting.

Each chunk of the output has timestamps aroung it in the style :-

rc sysinit logging started at Wed May 30 08:21:28 2018
...
rc sysinit logging stopped at Wed May 30 08:21:28 2018

The chunks seem to include sysinit, default and off. This is probably quite reasonable although there is an oddity, in that the rc off chunks are repeated 3 times in all, Twice next to each other and then again after a reboot, following the rc sysinit chunk, with the actual times being repeated, followed by a repeat of the sysinit chunk! Only the first appearance of the off chunk actually has the closing timestamp. I wonder whether there is a problem with doing some of the logging when the disk may not be available and the info is stored in memory and then cleared to disk later, but it seems to be carried over a boot from cold! This is not a major problem, although it is a bit untidy and rc.log will grow quicker that necessary.

If the time stamps are to be believed then the length of time taken for each stage would appear to be

sysinit <1 sec.
default ~12 sec.
off     ~4 sec. which includes saving the dependency cache

I have also tried turning on the parallel boot in /etc/rc.conf with rc_parallel="YES". So far this has not caused any hangs. The logging gets a bit more interesting as the messages from the parallel daemons gets interleaved. This is a sort of "you asked for it, you got it"! To help you decipher the logs, each part of a message is prefixed by the name of the service. Is it any faster? Well, looking at the timestamps again :-

sysinit <1 sec.
default ~6 sec.
off     ~1 sec. which still includes saving the dependency cache

So you might think that the boot is 6s faster and shutdown 3s faster. I'm not sure that it is that obvious when you are sat in front of the machine.

Looking at the logs like this, you tend to notice error messages that you might have otherwise missed. I spotted that this line appears a couple of times :-

networking            |/sbin/dhclient-script: 10: [: =: unexpected operator

I assume that this is supposed to be an error on line 10. Having a look at /sbin/dhclient-script and depending on how you count the lines (!) I can see

        while ! { : >> "$file"; } 2>/dev/null; do

but I don't know if this is where or what the problem might be. Anyway dhcp seems to work.

Geoff

Last edited by Geoff 42 (2018-05-30 14:24:14)

Offline

Board footer