You are not logged in.

#1 2015-06-03 09:34:08

replabrobin
Member
Registered: 2011-11-06
Posts: 81

Another go at installing runit into arch

For what it's worth I created some scripts to assist in converting arch linux to use runit.

sd2runit

it's mostly based on the eudev-openrc work with some repositories of mine thrown in.

As always with this sort of thing use at your own risk sad

I haven't yet found out how to make linux unmount all its disks and shutdown when systemd/init refuses to obey signals. The force-shutdown script is a workaround, but always leaves some inodes disjointed.

It's very likely you don't have exactly the same primitive non-x11 setup I have been using to test this in a VM. If you find something you believe is definitely required, by all means let me know.

Offline

#2 2015-06-03 14:59:44

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,833

Re: Another go at installing runit into arch

Take a look at my aur packag for void-runit.... You more than likely need a shutdown script. If you need any help email me....


Comments, suggestions, donations please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#3 2015-06-03 15:48:01

replabrobin
Member
Registered: 2011-11-06
Posts: 81

Re: Another go at installing runit into arch

Mr Green, I have shutdown after booting into runit. However, after removing systemd and installing runit + shutdown/pause/reboot etc etc I find I'm still running systemd (prior to first reboot) in memory. At that point just running init 0 or whatever has no effect on the still resident systemd (pid 1).  I have tried signalling process 1, but systemd doesn't seem to respond to signals when its  universe is gone. Thus I try sync plus various sys req stuff to get a shutdown. Probably the proper way to do this is to first install runit, reboot using runit as init and then remove systemd. Alternatively I could create all the binary packages I need; then signal systemd to go into single user mode and only then remove systemd and install the replacement pkgs not sure the last would actually work though.

Offline

#4 2015-06-04 08:13:15

replabrobin
Member
Registered: 2011-11-06
Posts: 81

Re: Another go at installing runit into arch

OK it seems you can use alt+sysrq sequences to do the clean shutdown, but you need to use

echo 1 > /proc/sys/kernel/sysrq

first.

With a physical keyboard you can then enter various controls as detailed here.

If you are using a VM then type the echo command and then use a script on the host like this

@echo off
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" controlvm arch-vm keyboardputscancode 1d 38 54  12 92   d4 b8 9d
sleep 1
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" controlvm arch-vm keyboardputscancode 1d 38 54  17 97   d4 b8 9d
sleep 1
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" controlvm arch-vm keyboardputscancode 1d 38 54  1f 9f   d4 b8 9d
sleep 1
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" controlvm arch-vm keyboardputscancode 1d 38 54  16 96   d4 b8 9d
sleep 1
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" controlvm arch-vm keyboardputscancode 1d 38 54  18 98   d4 b8 9d

to issue the correct key codes to the VM console (see here).

The systemd-free.org installation has something like this in step 16, but unless you are in rescue mode already you cannot expect it to work well as they omit the TERM & KILL signals which are needed to free up all the disks. Obviously a kill everything in a script will also kill the script so likely you never reach the sync/unmount/reboot phase.

Offline

#5 2015-06-04 14:46:50

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,833

Re: Another go at installing runit into arch

To get a fully systemd free system requires quite a few packages from systemd-free repo. More so with X. Did not have any issues with running void runit scripts under arch, as they shipped with power scripts. Only some of there paths were flaky but very easy to fix,


Comments, suggestions, donations please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#6 2015-06-04 14:55:24

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,833

Re: Another go at installing runit into arch

As for removing systemd you have to have runit running with eudev before you can uninstall it. Think you still need eudev-systemd compact to keep pacman happy....

Did even see a patched veriosn of mkinitcpio :-) might be going too far.

As for services most are easy to find, I managed to get a very archbang like system up and running in a VM with not too much trouble.

Really really really want a runit version of Archbang would certainly make me very happy...


Comments, suggestions, donations please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#7 2015-06-05 00:50:16

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,833

Re: Another go at installing runit into arch

Link fest....

http://woozle.org/~neale/papers/arch-runit.html

http://rubyists.github.io/2011/05/02/ru … -else.html

https://github.com/voidlinux/void-runit

Have used arch-runit but void-runit is based on ignite (which is in aur), could be tweaked for Arch... think there is a service pkgbuild too in aur (for reference)


Comments, suggestions, donations please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#8 2015-06-05 03:53:08

replabrobin
Member
Registered: 2011-11-06
Posts: 81

Re: Another go at installing runit into arch

Mr Green wrote:

As for removing systemd you have to have runit running with eudev before you can uninstall it. Think you still need eudev-systemd compact to keep pacman happy....


After doing the base install using my script I find I have these processes

# pstree
runit─┬─runsvdir─┬─6*[runsv───agetty]
      │          ├─2*[runsv─┬─socklog]
      │          │          └─svlogd]
      │          ├─runsv───dhcpcd
      │          └─runsv───sshd───sshd───bash───pstree
      └─udevd

and I find these systemd dependencies

root@arch-vm:~/tmp
# ./pkgdependson libsystemd
libatasmart
root@arch-vm:~/tmp
# ./pkgdependson systemd
device-mapper
libusb
lvm2
pcmciautils

which are satisfied using eudev-systemdcompat. I don't think there's a problem with X11 as one can use xorg-xwrapper / desktop-privileges from aur. I have certainly got slim + openbox working and I suppose lxdm wouldn't be that hard.

The big problem is political though, in an email Steve Litt author of manjaro experiments says

As fast as we remove systemd, the systemd "cabal"
grows new roots into formerly independent software.

so any attempt at keeping Arch/Archbang running without systemd will require ongoing effort. Attempts like voidlinux, springlinux & many others will delay, but not extinguish the problem, Red Hat has a lot of muscle. If as seems likely they push kdbus into the kernel and systemd into the boot process the holdouts will need to work ever harder to keep themselves systemd free. messing around with computers used to be fun; it is far less transparent now than it used to be.

Last edited by replabrobin (2015-06-05 03:54:11)

Offline

#9 2015-06-05 10:30:45

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,833

Re: Another go at installing runit into arch

Void is still very early in its development and my attempts to run a spin off have only made its developers very upset. I do not dislike systemd I just want the freedom too chose what I want to run. You do not even have to remove systemd too run runit, for one system-udev will still work along with dbus. It is when you remove it things get more complicated. To have systemd installed and mostly dormant is not really an issue, look at uselessd.

Lxdm:

/etc/sv/lxdm/run

#!/bin/sh
exec lxdm

Then

chmod +x run

Start it

ln -s /etc/sv/lxdm /var/service

From Springlinux add too .bashrc

alias state='sudo sv status /var/service/*'

Comments, suggestions, donations please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#10 2015-07-25 02:36:40

replabrobin
Member
Registered: 2011-11-06
Posts: 81

Re: Another go at installing runit into arch

I made another arch aur package https://aur4.archlinux.org/packages/arch-runsvdir-init/ that removes the runit process and relies directly on a top level runsvdir. This is like the busybox runit, but with libc. I left the old runit-init in place and modified the void shutdown stuff to allow working with both. The runsvdir-init is a bash script which runs the 1 & 2 scripts and then execs runsvdir with the 3 script as the follower to be run in case of a shutdown. With this in place my pstree looks like this

runsvdir─┬─5*[runsv───agetty]
         ├─2*[runsv─┬─socklog]
         │          └─svlogd]
         ├─runsv───slim───Xorg
         ├─runsv───login───bash
         ├─runsv───sshd───sshd───sshd───bash───pstree
         ├─runsv───dhcpcd
         ├─runsv───avahi-daemon───avahi-daemon
         ├─runsv───dbus-daemon
         └─udevd

*NB* this code not well tested and needs review. If you are starting from a runit installation then the shutdown may need to be done carefully.

Offline

#11 2015-07-26 00:00:49

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,833

Re: Another go at installing runit into arch

Away at the moment so cannot test, would like have our own runit scripts so we do not rely on void at all. Some of the code is more specific too them rather than arch.

Certainly runit is fast, easy to use and makes much more sense to me than systemd.

If I had six months I would create my own distro....


Comments, suggestions, donations please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#12 2015-08-02 13:47:02

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,833

Re: Another go at installing runit into arch

Got two runit installs running, Using Springliinux ISO I managed to install an arch base and then add arch-runit. Xorg is running currently using udev and dbus (systemd). Boots really quickly. Goal would be too create a minimal arch runit install. Currently using i3, lxteminal and netsurf (figured the smallest browser).

Going too mess with scripts too reduce boot time even more....

Might clone void-runit again and make them more arch specific... Iron out some issues (remove lxc stuff)

Loving working with my machine on an init level feel like I have far mor control over system.


Comments, suggestions, donations please feel free to contact me mrgreen(at)archbang(dot)org

Offline

Board footer

Powered by FluxBB