Booting MX-19 with runit

Here is where you can post tips and tricks to share with other users of MX. Do not ask for help in this Forum.
Message
Author
anixer

Re: Booting MX-19 with runit

#11 Post by anixer »

Just a hey cool, it's interesting to see nixers playing with their systems and doing this type of thing. Someone is bound to have some fun and learn things in the process. Also gone with getting rid of any display manager and auto-login/startx for awhile now. Dang it, was hoping to see less system overhead by a wider margin here. But considering runit vs sysV, what they do, makes sense it's not by much and lightdm is all of like 8mbs-RAM or so anyway. Cool how-to Head_on and thanks for posting your findings other nixers. Nothing ventured, nothing gained. :)

User avatar
jeffreyC
Posts: 522
Joined: Mon May 27, 2019 10:39 am

Re: Booting MX-19 with runit

#12 Post by jeffreyC »

It looks like Artix has a runit service to start lightdm.

SwampRabbit
Posts: 3602
Joined: Tue Jun 14, 2016 2:02 pm

Re: Booting MX-19 with runit

#13 Post by SwampRabbit »

I've always been wanting to play more with runit, it is lighter and faster than OpenRC.

I haven't tried Artix yet, but I did like Manjaro-OpenRC.

I don;t know if the Gentoo wiki is still accurate:
https://wiki.gentoo.org/wiki/Comparison_of_init_systems

What's the downside (if any) or "so what" of Per-service configuration being no?
NEW USERS START HERE FAQS, MX Manual, and How to Break Your System - Don't use Ubuntu PPAs! Always post your Quick System Info (QSI) when asking for help.

Huckleberry Finn

Re: Booting MX-19 with runit

#14 Post by Huckleberry Finn »

jeffreyC wrote: Fri Dec 06, 2019 9:03 pm It looks like Artix has a runit service to start lightdm.
Yes. Maybe there's a way to adapt..

Meanwhile I learned that Slim and LXDM also don't work.
_____________________________________________________________________________

Also found this: https://github.com/mat8913/runit-script ... ightdm/run

And http://smarden.org/runit/faq.html#run :

How do I run a service under runit service supervision ?

I want a service to be run under runit service supervision, so that it's automatically started on system boot, and supervised while system uptime. How does that work?

Answer: runit doesn't use the usual /etc/init.d/ init script interface, but uses a directory per service. To integrate a service into the runit init scheme, create a service directory for the service, and tell runit about it.

How do I create a service directory for the use with runit ?

Answer: Service directories usually are placed into the /etc/sv/ directory. Create a new directory for your service in /etc/sv/, put a ./run script into it, and make the script executable. Note that for the use with runit, service daemons must not put themself into the background, but must run in the foreground. Here's a simple example for a getty service:

$ cat /etc/sv/getty-2/run
#!/bin/sh
exec getty 38400 tty2 linux
$

Note the exec in the last line, it tells the shell that interprets the script to replace itself with the service daemon getty; this is necessary to make controlling the service work properly.

How do I tell runit about a new service ?

I created a service directory for a service that should run under runit service supervision. How do I tell runit about the new service directory, so that it picks up and runs the service by default?

Answer: Create a symbolic link in /service/ pointing to the service directory, runit will pick up the service within the next five seconds, and automatically start it on system boot. E.g.:

# ln -s /etc/sv/getty-2 /service/

User avatar
anticapitalista
Developer
Posts: 4282
Joined: Sat Jul 15, 2006 10:40 am

Re: Booting MX-19 with runit

#15 Post by anticapitalista »

slim works with runit on antiX-19. You have to edit /etc/slim.conf.

Uncomment this line:

Code: Select all

# login_cmd         exec /bin/bash -login /etc/X11/Xsession %session 


Comment this one:

Code: Select all

login_cmd   setsid /usr/local/bin/desktop-session %session
anticapitalista
Reg. linux user #395339.

Philosophers have interpreted the world in many ways; the point is to change it.

antiX with runit - lean and mean.
https://antixlinux.com

User avatar
Head_on_a_Stick
Posts: 919
Joined: Sun Mar 17, 2019 3:37 pm

Re: Booting MX-19 with runit

#16 Post by Head_on_a_Stick »

Richard wrote: Fri Dec 06, 2019 6:27 pm Ran
sudo apt update && sudo apt install runit{,-init}
on EeePC 32 bit netbook.

But it still rebooted into SysVinit.
How are you checking the init system? I use this:

Code: Select all

cat /proc/1/comm
Make sure that the packages are installed:

Code: Select all

apt policy systemd{,-shim} runit{,-init}
jeffreyC wrote: Fri Dec 06, 2019 9:03 pm It looks like Artix has a runit service to start lightdm.
Do you have a link to that? I can't find it in the live ISO or their LightDM package.

The display manager can be started manually with

Code: Select all

sudo /etc/init,d/lightdm start
Or

Code: Select all

sudo service lightdm start
But then the reboot & poweroff buttons are greyed out in the exit dialogue (they work fine with a console login).
SwampRabbit wrote: Fri Dec 06, 2019 9:24 pm What's the downside (if any) or "so what" of Per-service configuration being no?
Not entirely sure what that means tbh, the Gentoo wiki doesn't elaborate further :confused:
Huckleberry wrote: Fri Dec 06, 2019 9:33 pm How do I run a service under runit service supervision ?
Debian's implementation automatically runs any services in /etc/rc2.d/ because runleveles 2-5 are identical. MX separates the runlevels further, perhaps this is why it won;t work. The LightDM init script has different runlevels listed for the Debian and MX package versions.
mod note: Signature removed, please read the forum rules

Huckleberry Finn

Re: Booting MX-19 with runit

#17 Post by Huckleberry Finn »

anticapitalista wrote: Sat Dec 07, 2019 7:18 am slim works with runit on antiX-19. You have to edit /etc/slim.conf.
Ah, so good. (I've read on some forum yesterday but that's such a good news).

In fact, I'd installed Slim on 18.3 (just to try) but couldn't make it work no matter what I did... I'll try on 19 again.

User avatar
Head_on_a_Stick
Posts: 919
Joined: Sun Mar 17, 2019 3:37 pm

Re: Booting MX-19 with runit

#18 Post by Head_on_a_Stick »

I've got LightDM working now :happy:

Edit the file at /etc/runit/2 and add some lines for the other runlevels so it looks like this:

Code: Select all

#!/bin/sh

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin
SVDIR=/etc/service

# This script is also invoked in runit-systemd and runit-sysv packages.
# We must start sulogin and sysv scripts only if `runit' is current init
# system.
if [ -f /run/runit.stopit ] ; then
        # single mode
        if grep -q -w -i 'single' /proc/cmdline ; then
                chpst -P /sbin/sulogin -p /dev/tty1
        fi


        # Give sysv scripts 90 seconds (hardcoded in async-timeout source) to
        # start. If something goes wrong, they are detached from controlling
        # terminal.
        #
        # In this case tty1 would likely look ugly -- output from sysv scripts
        # is written over terminal session, but at least we would be able to
        # login.

        /lib/runit/async-timeout /lib/runit/run_sysv_scripts '/etc/rc2.d'
        /lib/runit/async-timeout /lib/runit/run_sysv_scripts '/etc/rc3.d'
        /lib/runit/async-timeout /lib/runit/run_sysv_scripts '/etc/rc4.d'
        /lib/runit/async-timeout /lib/runit/run_sysv_scripts '/etc/rc5.d'
fi

exec env - PATH=$PATH \
runsvdir -P "${SVDIR}" 'log: ...........................................................................................................................................................................................................................................................................................................................................................................................................'
It's not perfect because some services are started several times but LightDM runs and the exit dialogue works.
mod note: Signature removed, please read the forum rules

Huckleberry Finn

Re: Booting MX-19 with runit

#19 Post by Huckleberry Finn »

Head_on_a_Stick wrote: Sat Dec 07, 2019 7:27 am
jeffreyC wrote: Fri Dec 06, 2019 9:03 pm It looks like Artix has a runit service to start lightdm.
Do you have a link to that? I can't find it in the live ISO or their LightDM package.
Would this work? https://github.com/artix-linux/runit-artix
(Edit: I see nothing related to DM )

https://wiki.artixlinux.org/Main/Runit
Last edited by Huckleberry Finn on Sat Dec 07, 2019 7:40 am, edited 1 time in total.

User avatar
Head_on_a_Stick
Posts: 919
Joined: Sun Mar 17, 2019 3:37 pm

Re: Booting MX-19 with runit

#20 Post by Head_on_a_Stick »

Huckleberry wrote: Sat Dec 07, 2019 7:36 am Would this work? https://github.com/artix-linux/runit-artix
Ah-ha, that's the ticket — thanks!

LightDM now works after a fashion (see my last post) but migrating to a runit script would be ideal.
mod note: Signature removed, please read the forum rules

Post Reply

Return to “Tips & Tricks by users”