You are not logged in.

#1 2014-10-26 01:24:19

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

Runit-init under Arch Linux

Am looking at using runit-init under ArchBang, need to figure out a few things myself and test it on a vm then maybe can create a working iso.

Going to base my work on this article/guide

https://woozle.org/%7Eneale/papers/arch-runit.html

Issues:

Udev
Xorg drivers
Boot scripts (rc.local style)
Power options reboot/halt/poweroff

If anyone is interested in trying out runit then post to this thread, I will start a guide add links and tips as I go.


Comments, suggestions, donations please feel free to contact me mrgreen(at)archbang(dot)org Artix information https://artixlinux.org/migrate.php

Offline

#2 2014-10-26 09:00:10

pablokal
Administrator
From: Nijmegen, Holland
Registered: 2010-10-12
Posts: 3,631
Website

Re: Runit-init under Arch Linux

Good find!! When I'll find the time I will do also some experimenting.

This seems a very important vulnerability in this set up:

This will still run udev and bootlogd from /etc/rc.sysinit. I tried to set up mdev from busybox as a udev replacement, but Xorg wants udev, and I was having other problems getting drivers loaded, so I'm just trusting the the Arch devs here.

He has a chapter later on on removing udev, but this all seems very vulnerable to developments instigated by devs who seem sabotaging alternatives to systemd.

This is beyond me:

You now need to write startup scripts for things you like to run, like dhcpcd, ntpd, maybe xdm. You're an Arch Linux sysadmin, you should know what you need, and I can't help you past here.

This seems a valuable resource: https://github.com/voidlinux/void-runit

He wrote it based on https://github.com/chneukirchen/ignite that is made by  an Arch user, so his work maybe even more useful to us.
Ignite in AUR: https://aur.archlinux.org/packages/ignite/

About Ignite

= Ignite, a simple and robust init replacement

ignite is a set of scripts to boot Arch Linux using runit for service
supervision.

== Benefits

Robust, proven software: ignite is based on runit (which has been in
development since 2001), a high quality implementation of ideas dating
back to 1997 and earlier.

Simple configuration: ignite allows you to configure Arch using
/etc/rc.conf, like back in the old days.

Low overhead: runit-run is a tiny, statically linked binary that only
does the absolutely essential things.

Non-intrusive: ignite wont replace your cron, getty or syslog-ng.  You
are still free to do that yourself, if you want to.

Portability: the scripts can be easily adapted to other Linux
distribution, or even other unixish operating systems.

Full control: ignite will never start anything you didn't tell it
about.  ignite also supports read-only root file systems.

== Setup

READ THIS CAREFULLY OR YOUR SYSTEM WILL NOT BOOT SUCCESSFULLY.

If you booted with sysvinit, make a copy of /usr/bin/init to
/usr/bin/init.sysv, else you cannot reboot cleanly.

Install runit-musl and ignite-git from AUR.  Ensure that you have at least
one agetty-tty1 process in DAEMONS.  Note that services mentioned in
/etc/inittab will not be picked up anymore.

You can reboot with "init.sysv 6" after installation if you booted
with sysvinit.

read more> https://github.com/chneukirchen/ignite


Getting your questions answered here at ArchBang Forums
Please! Always give hardware info, if there is a chance that 's relevant: #lspci -vnn
On Arch(bang) and Openbox: http://stillstup.blogspot.com/

Offline

#3 2014-10-26 10:20:09

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

Re: Runit-init under Arch Linux

For now I do not really want to remove systemd, we can use it as a fall back should system fail to boot. Busybox mdev could handle what we need will not be sure until I test. If you do look at service files they are no more than a call to required daemon, most will be easy to write and of course you have systemd service files to reference too.

Ignite gives user am experience similar to old initscripts, if I can get system running just using runit-init then I will be happier.

This will only be of use to more experienced users, those not afraid to administer there system.


Comments, suggestions, donations please feel free to contact me mrgreen(at)archbang(dot)org Artix information https://artixlinux.org/migrate.php

Offline

#4 2014-10-26 13:20:52

pablokal
Administrator
From: Nijmegen, Holland
Registered: 2010-10-12
Posts: 3,631
Website

Re: Runit-init under Arch Linux

I think that is a good way to go. I must admit I got nostalgic reading about the old rc.conf that Ignite uses, but it is best to create a solution that is usable for users with different levels of experience


Getting your questions answered here at ArchBang Forums
Please! Always give hardware info, if there is a chance that 's relevant: #lspci -vnn
On Arch(bang) and Openbox: http://stillstup.blogspot.com/

Offline

#5 2014-10-26 15:23:17

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

Re: Runit-init under Arch Linux

Not every archlinux package needs a daemon to be run at boot. Am tempted to use connman for networking as netctl is simply not going to work. Already mulling over auto login and lastmin services.


Comments, suggestions, donations please feel free to contact me mrgreen(at)archbang(dot)org Artix information https://artixlinux.org/migrate.php

Offline

#6 2014-10-26 18:18:36

neale
Member
Registered: 2014-10-26
Posts: 11
Website

Re: Runit-init under Arch Linux

Hi, I wrote runit-init. Happy to answer questions, and I'll attempt to keep up with this thread.

I actually don't use udev at all anymore. I thought I'd recently rewritten the page to remove references to needing it, I guess I missed a few. X11 starts fine without it, but one time out of ten (roughly) the keyboard is non-responsive. I keep meaning to look into it but I'm the only user so far and it's been easier to just power cycle smile

Starting daemons is not really difficult. You can "cp -a" one of the directories from /service and then edit its init file. If you guys are making your own packages, you can just drop a /service structure into your package and runit will notice it and launch your daemon automatically.

For legacy startup scripts I recommend having /service/sysvinit/run that would do something like:

#! /bin/sh

busybox run-parts -a start /etc/rc2.d/
sv d .

The first line runs your rc2.d scripts like the olden days. The second line tells runit to quit trying to restart this after it exits. I actually prefer to sleep for a long time (sleep 592d, for instance) but I reboot my machines a lot, this isn't a good idea for a distribution.

Here's what services I run on my laptop, on which I use xfce4:

$ sudo sv s /service/*                                                         
run: /service/dbus: (pid 622) 118258s; run: log: (pid 586) 118258s
run: /service/dhcp: (pid 630) 118258s; run: log: (pid 589) 118258s
down: /service/hdparm: 118258s
run: /service/hurtplurg: (pid 623) 118258s; run: log: (pid 588) 118258s
run: /service/klog: (pid 627) 118258s; run: log: (pid 584) 118258s
run: /service/lid: (pid 609) 118258s; run: log: (pid 585) 118258s
run: /service/local-init: (pid 629) 118258s; run: log: (pid 581) 118258s
run: /service/ntp: (pid 953) 118244s; run: log: (pid 576) 118258s
run: /service/ssh: (pid 625) 118258s; run: log: (pid 587) 118258s
run: /service/syslog: (pid 626) 118258s; run: log: (pid 582) 118258s
run: /service/tty1: (pid 633) 118258s; run: log: (pid 577) 118258s
run: /service/tty2: (pid 578) 118258s
run: /service/tty3: (pid 583) 118258s
run: /service/wpa-cli: (pid 836) 118255s; run: log: (pid 590) 118258s
run: /service/wpa-supplicant: (pid 632) 118258s; run: log: (pid 580) 118258s
run: /service/xdm: (pid 631) 118258s; run: log: (pid 579) 118258s

Offline

#7 2014-10-26 18:25:06

neale
Member
Registered: 2014-10-26
Posts: 11
Website

Re: Runit-init under Arch Linux

I ought to mention, the concern about packages depending more and more on systemd is well-placed, but so far hasn't been a tremendous problem. It just means that every 4 months or so I have to go root around to figure out the latest workaround. The most recent one was the stock kernel stopped providing /proc/sys/kernel/hotplug (the thing that calls mdev). That one took me a while to catch up with, but the kernel documentation for the new netlink technique was really helpful and even included example code that I grew into my own hotplug daemon.

I'll go back and make sure that article is actually up to date.

Offline

#8 2014-10-27 00:48:14

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

Re: Runit-init under Arch Linux

Hi Neale smile

Thanks for posts think it will be very useful to me and others to try our runit form themselves.

Is there any reason that I cannot use systemd udev for now? While I am messing with init I would have a fallback to boot system should I need it.

Not sure how good mdev is, have you looked at toolbox or sinit? Over busybox..


Comments, suggestions, donations please feel free to contact me mrgreen(at)archbang(dot)org Artix information https://artixlinux.org/migrate.php

Offline

#9 2014-10-27 05:56:11

pablokal
Administrator
From: Nijmegen, Holland
Registered: 2010-10-12
Posts: 3,631
Website

Re: Runit-init under Arch Linux

Hi Neal, I also want to thank you for your work on runit-init and the way you offer and are providing help.


Getting your questions answered here at ArchBang Forums
Please! Always give hardware info, if there is a chance that 's relevant: #lspci -vnn
On Arch(bang) and Openbox: http://stillstup.blogspot.com/

Offline

#10 2014-10-27 13:35:26

neale
Member
Registered: 2014-10-26
Posts: 11
Website

Re: Runit-init under Arch Linux

Mr Green wrote:

Hi Neale smile

Thanks for posts think it will be very useful to me and others to try our runit form themselves.

Is there any reason that I cannot use systemd udev for now? While I am messing with init I would have a fallback to boot system should I need it.

Not sure how good mdev is, have you looked at toolbox or sinit? Over busybox..

There's no reason you couldn't use systemd's udev, no. I ran this way for about a year. I just enjoy a challenge smile

I'm a big fan of busybox, and mdev is meeting all my needs so far, so I haven't shopped around for anything else. I did hook a run-parts system into mdev so that I could make packages to drop scripts, udev-style. This is how I got virtualbox USB devices to work.

Offline

#11 2014-10-27 14:36:49

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

Re: Runit-init under Arch Linux

Well I will test mdev and see how that goes. Need to get autologin for live cd and Lastmin script running, hopefully via rc.local.

We do not use swap live so may have to either remove or add a test, rest should be ok.

All I need to figure is how to add services so they run at boot ( little unclear on that one). Does runit check /service folder and run everything in it?

For now I will run dhcpd but at some point will need possibly connman to allow set up of wireless devices (so far it does not depend on systemd)


Comments, suggestions, donations please feel free to contact me mrgreen(at)archbang(dot)org Artix information https://artixlinux.org/migrate.php

Offline

#12 2014-10-27 17:08:08

oliver
Administrator
Registered: 2010-11-04
Posts: 2,209

Re: Runit-init under Arch Linux

pablokal wrote:

Hi Neal, I also want to thank you for your work on runit-init and the way you offer and are providing help.

I want to echo this sentiment too.  I was very impressed with runit on void linux

Offline

#13 2014-10-27 17:56:22

neale
Member
Registered: 2014-10-26
Posts: 11
Website

Re: Runit-init under Arch Linux

Mr Green wrote:

Well I will test mdev and see how that goes. Need to get autologin for live cd and Lastmin script running, hopefully via rc.local.

We do not use swap live so may have to either remove or add a test, rest should be ok.

All I need to figure is how to add services so they run at boot ( little unclear on that one). Does runit check /service folder and run everything in it?

For now I will run dhcpd but at some point will need possibly connman to allow set up of wireless devices (so far it does not depend on systemd)

I advise against doing anything in rc.local, since an error there could halt PID 1! rc.local should be used for things that absolutely positively cannot be started by runit. For instance, LVM, or userspace filesystems needed to start. Since rc.local is sourced by /sbin/init as PID 1, you could switch on a keyword in your kernel command-line to bypass runit and exec systemd instead.

Runit starts everything in /services at the same time, immediately after runit is started. So the way you add services to run at boot is to make /services/myservice, and put a "run" script in there that starts your service in the foreground with whatever arguments it needs.

When the "run" script exits, runit waits 1 second and tries it again. If you have dependencies, you can either check to see if they're met and exit if not, or just blithely exec the daemon and rely on it to exit if things aren't set up properly yet.

http://busybox.net/~vda/init_vs_runsv.html has a nice gentle introduction.

Offline

#14 2014-10-27 17:59:35

neale
Member
Registered: 2014-10-26
Posts: 11
Website

Re: Runit-init under Arch Linux

I just remembered, I don't think I've documented this anywhere.

Because I'm currently the only user and I'm lazy, my runit-init AUR doesn't provide "reboot" or "halt"!

To reboot, run "init 6".

To halt, run "init 0".

If you have a sysv shutdown command installed, it *should* do the right thing. Busybox's halt and reboot also do the right thing, if you want to symlink /sbin/halt and /sbin/reboot to /bin/busybox.

Ctrl-Alt-Del does a hard reset, currently. I actually prefer this, but I think it's just a matter of writing to something in /proc to have it send the appropriate signal to PID 1.

Good luck, init-nauts.

Last edited by neale (2014-10-27 18:00:00)

Offline

#15 2014-10-28 02:50:28

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

Re: Runit-init under Arch Linux

Am much happier now, understand clearer how services work. Now need a way to run our startup scripts pre login. Think you did mention a way of stopping a service after it has run.

Thank you for all your help, really do hope we can runit under ArchBang smile


Comments, suggestions, donations please feel free to contact me mrgreen(at)archbang(dot)org Artix information https://artixlinux.org/migrate.php

Offline

#16 2014-10-28 03:30:51

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

Re: Runit-init under Arch Linux

Can someone point me too runsvdir script please?


Comments, suggestions, donations please feel free to contact me mrgreen(at)archbang(dot)org Artix information https://artixlinux.org/migrate.php

Offline

#17 2014-10-28 11:34:29

pablokal
Administrator
From: Nijmegen, Holland
Registered: 2010-10-12
Posts: 3,631
Website

Re: Runit-init under Arch Linux


Getting your questions answered here at ArchBang Forums
Please! Always give hardware info, if there is a chance that 's relevant: #lspci -vnn
On Arch(bang) and Openbox: http://stillstup.blogspot.com/

Offline

#18 2014-10-28 15:01:40

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

Re: Runit-init under Arch Linux

I was looking over init script and saw runsvdir but did not see it in runit-init source. Does not seem to be part of busybox either. Unless I am missing something..

From what I have read I may have figured out how to run our scripts in ArchBang live. I can remove swap from init maybe make it a one shot service if needed by user.

Really want to get working on building an iso smile


Comments, suggestions, donations please feel free to contact me mrgreen(at)archbang(dot)org Artix information https://artixlinux.org/migrate.php

Offline

#19 2014-10-29 02:37:03

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

Re: Runit-init under Arch Linux

Ok figured out runsvdir, one thing I might need is a dbus service. Noticed Neale has one in his service list.

@Neale any chance of taking a look at dbus service file?


Comments, suggestions, donations please feel free to contact me mrgreen(at)archbang(dot)org Artix information https://artixlinux.org/migrate.php

Offline

#20 2014-10-29 05:19:04

pablokal
Administrator
From: Nijmegen, Holland
Registered: 2010-10-12
Posts: 3,631
Website

Re: Runit-init under Arch Linux

Have you considered mailing Neale?


Getting your questions answered here at ArchBang Forums
Please! Always give hardware info, if there is a chance that 's relevant: #lspci -vnn
On Arch(bang) and Openbox: http://stillstup.blogspot.com/

Offline

#21 2014-10-29 05:43:05

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

Re: Runit-init under Arch Linux

Will do, got a few things to sort out with him.


Comments, suggestions, donations please feel free to contact me mrgreen(at)archbang(dot)org Artix information https://artixlinux.org/migrate.php

Offline

#22 2014-10-29 07:12:13

moravec
Member
From: near volcano, pacific NW, USA
Registered: 2010-10-07
Posts: 114
Website

Re: Runit-init under Arch Linux

Don't know if this will help but here is the run script from void for dbus...

 #!/bin/sh
[ ! -d /run/dbus ] && install -m755 -g 22 -o 22 -d /run/dbus
dbus-uuidgen --ensure
exec dbus-daemon --system --nofork --nopidfile

ex Distro Junkie, Archbang addict

Offline

#23 2014-10-29 09:25:13

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

Re: Runit-init under Arch Linux

Looks good just wondered how Neale had it set up. Thanks smile


Comments, suggestions, donations please feel free to contact me mrgreen(at)archbang(dot)org Artix information https://artixlinux.org/migrate.php

Offline

#24 2014-10-29 14:16:02

neale
Member
Registered: 2014-10-26
Posts: 11
Website

Re: Runit-init under Arch Linux

Hi. I didn't get an email that there was activity here, sorry I'm late.

Most of my stuff is either in http://woozle.org/neale/g.cgi/aur/runit-init/tree/ or http://woozle.org/neale/g.cgi/aur/runit-desktop/tree/. My two AURs actually do the installation from these "source" packages.

Here's /service/dbus/run:

#! /bin/sh

exec 2>&1

mkdir -p /run/dbus
exec dbus-daemon --system --nofork --nopidfile

I didn't know about dbus-uuidgen, although it looks like this ought to have been called by pacman after installing dbus (haven't verified this, just reading the man page). I don't think I'm currently running anything that uses dbus so I wouldn't have noticed if things weren't working.


Mr Green asked me in email if swap could be a service. Yeah, it could, that's easy enough:

#! /bin/sh

swapon -a
sv d .

Or you could put complex logic to go probe for swap partitions on all attached drives and add them. Dunno what you have in mind, it sounds like this is for a LiveCD maybe.

Offline

#25 2014-10-29 14:19:26

neale
Member
Registered: 2014-10-26
Posts: 11
Website

Re: Runit-init under Arch Linux

Mr Green wrote:

Am much happier now, understand clearer how services work. Now need a way to run our startup scripts pre login.

Regarding this, you might have better luck with Gerrit Pape's runit. http://smarden.org/runit/

It's basically the same as busybox runit, but it has this crazy (to me) 1/ 2/ and 3/ scripts directory. I always felt like if I ever needed that kind of functionality I'd just call

run-parts /etc/runit/1

from /sbin/init. So that's the way I'd have done it. But you guys, as a distribution, might prefer the Gerrit's runit, since it's a little beefier and comes with support for these things built-in.

Offline

#26 2014-10-31 08:50:09

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

Re: Runit-init under Arch Linux

Thought I would try minirc again as I it worked for me in the past.

[mrgreen@arch ~]$ pstree
init─┬─3*[agetty]
     ├─crond
     ├─2*[dbus-daemon]
     ├─dbus-launch
     ├─dhcpcd
     ├─i3bar───i3status
     ├─login───startx───xinit─┬─Xorg.bin
     │                        └─i3
     ├─lxterminal─┬─bash───pstree
     │            ├─gnome-pty-helpe
     │            └─{gmain}
     ├─spacefm
     ├─syslog-ng───syslog-ng
     └─systemd-udevd

X works out of the box, I am using systemd for udev as mdev/evdev did not work (or I do not have set up correctly)

Daemons running

[mrgreen@arch ~]$ rc
[X] syslog-ng
[X] alsa
[X] crond
[X] dbus
[ ] wpa_supplicant
[X] dhcpcd

I did find minirc easier to setup and is tiny


Comments, suggestions, donations please feel free to contact me mrgreen(at)archbang(dot)org Artix information https://artixlinux.org/migrate.php

Offline

#27 2014-11-01 01:34:34

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

Re: Runit-init under Arch Linux

After switching runit too use systemd-udev I get

[mrgreen@arch run]$ pstree
runsvdir─┬─VBoxClient───{SHCLIP}
         ├─VBoxClient
         ├─VBoxClient───{X11 monitor}
         ├─VBoxClient───{Host events}
         ├─VBoxClient─┬─{HGCM-NOTIFY}
         │            └─{X11-NOTIFY}
         ├─dbus-daemon
         ├─dbus-launch
         ├─i3bar───i3status
         ├─lxterminal─┬─bash───pstree
         │            ├─gnome-pty-helpe
         │            └─{gmain}
         ├─runsv─┬─exe
         │       └─hurtplurg
         ├─runsv───dbus-daemon
         ├─2*[runsv─┬─busybox]
         │          └─exe]
         ├─2*[runsv───exe]
         ├─runsv─┬─exe
         │       └─login───startx───xinit─┬─Xorg.bin
         │                                └─i3
         ├─spacefm
         └─systemd-udevd
[mrgreen@arch run]$ ls -ls /run/dbus
total 0
0 srwxrwxrwx 1 root root 0 Nov  1 07:22 system_bus_socket
[mrgreen@arch run]$ 

Could give you output from sv but forgot the syntax wink

I have X,keyboard,mouse,auto start X (although not sure if I have right code for that), dbus is running so can switch too connman at some point


Comments, suggestions, donations please feel free to contact me mrgreen(at)archbang(dot)org Artix information https://artixlinux.org/migrate.php

Offline

#28 2014-11-01 02:17:13

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

Re: Runit-init under Arch Linux

Have updated my github to reflect working scripts


Comments, suggestions, donations please feel free to contact me mrgreen(at)archbang(dot)org Artix information https://artixlinux.org/migrate.php

Offline

#29 2014-11-01 02:53:24

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

Re: Runit-init under Arch Linux

Thought I would be clever and install eudev and dbus-nosystemd then my luck ran out. My virtual system no longer boots and I cannot reinstall systemd.

EDIT have managed to fix VM


Comments, suggestions, donations please feel free to contact me mrgreen(at)archbang(dot)org Artix information https://artixlinux.org/migrate.php

Offline

#30 2014-11-01 08:13:11

neale
Member
Registered: 2014-10-26
Posts: 11
Website

Re: Runit-init under Arch Linux

Probably ought to down hurtplurg if you're running udev.

sv d hurtplurg
touch /service/hurtplurg/down

Offline

#31 2014-11-09 19:04:47

moravec
Member
From: near volcano, pacific NW, USA
Registered: 2010-10-07
Posts: 114
Website

Re: Runit-init under Arch Linux

So I tried setting up the newest vanilla arch in virtualbox using runit using the aur packages just to see if I could do it.  Everything worked pretty good until I installed Xorg .  When I startx  my DM either twm or i3 my mouse works but not my keyboard.  Does this have anything to do with not using the systemed-udev?


ex Distro Junkie, Archbang addict

Offline

#32 2014-11-10 00:41:40

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

Re: Runit-init under Arch Linux

I could not get x to work unless I used systemd-udev, then keyboard and mouse works


Comments, suggestions, donations please feel free to contact me mrgreen(at)archbang(dot)org Artix information https://artixlinux.org/migrate.php

Offline

#33 2014-11-10 05:28:10

pablokal
Administrator
From: Nijmegen, Holland
Registered: 2010-10-12
Posts: 3,631
Website

Re: Runit-init under Arch Linux

In Void it works, so you don't need systemd;
maybe this will help you further: https://github.com/voidlinux/documentat … dow-System
Check the keyboard section.
Alternately you can try to create these two config files for
/etc/X11/xorg.conf.d
10-keyboard.conf

Section "InputDevice"
	identifier "keyboard0"
	driver "kbd"
	option "AutoServerLayout" "on"
EndSection

and mouse
30-mouse.conf

Section "InputDevice"
	identifier "Mouse0"
	driver "mouse"
	option "AutoServerLayout" "on"
	option "device" "/dev/input/mice"
EndSection

source: http://woozle.org/neale/g.cgi/aur/runit … org.conf.d


Getting your questions answered here at ArchBang Forums
Please! Always give hardware info, if there is a chance that 's relevant: #lspci -vnn
On Arch(bang) and Openbox: http://stillstup.blogspot.com/

Offline

#34 2014-11-12 08:32:55

neale
Member
Registered: 2014-10-26
Posts: 11
Website

Re: Runit-init under Arch Linux

I get intermittent keyboard problems. Maybe 1 boot out of 5, there's no keyboard. I haven't been able to figure out what the difference is.

I've considered putting a small delay in the xdm service file. But honestly I haven't had time to debug this one. If you guys also don't have time, you're going to have to use udev.

Offline

#35 2014-11-12 14:48:37

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

Re: Runit-init under Arch Linux

@neale if you do get time you should check out Void Linux.


Comments, suggestions, donations please feel free to contact me mrgreen(at)archbang(dot)org Artix information https://artixlinux.org/migrate.php

Offline

#36 2014-11-22 10:42:14

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

Re: Runit-init under Arch Linux

@neale can you start services under chroot? and does rc.local run post service start?


Comments, suggestions, donations please feel free to contact me mrgreen(at)archbang(dot)org Artix information https://artixlinux.org/migrate.php

Offline

#37 2015-01-16 15:37:41

neale
Member
Registered: 2014-10-26
Posts: 11
Website

Re: Runit-init under Arch Linux

You can start services in a chroot with chroot, not sure how else it's done (I went from sysvinit directly to runit).

Sorry for the late reply, seems like I'm not getting notices of activity in here.

Offline

#38 2015-03-16 05:53:45

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

Re: Runit-init under Arch Linux

I wanted to try out various non-systemd things with Arch and got quite a long way. Neale's runit-init is fine and seems to work well. I think I prefer the runit that comes with voidlinux though. I don't hanker for the old rc.conf way of doing things although having a global config file is nice.

As a test I tried copying the initrd from void to Arch linux. I had to fix up the kernel modules to the right version, but that initrd works fine with Arch. After noticing files called systemd in there I removed those and then used eudev to populate the udevd for the init fs. That systemd free (I believe) version of the init fs worked fine and allowed me to start up a systemd based arch.

After the first of these "Arch experiments"  I think the first thing that needs to be cleaned up is mkinitcpio which currently depends on having systemd around ie we need a mkinitcpio-nosystemd. I'm not sure how hard that would be, but the init in existing mkinitcpio certainly has systemd commands for creating temp files etc etc. systemd seems even more invasive now than when others tried to eliminate it.

Offline

#39 2015-03-16 10:13:23

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

Re: Runit-init under Arch Linux

Eudev is a good call, could never get mdev to work correctly. I grabbed some of the packages from openrc setup (repo) it allowed me to run xorg without systemd.

Long term it would be difficult to maintain an arch system that is systemd free. Certainly it is a better to go with Void as everything works out of the box. Had thought about using void-runit scripts too under Arch (but that failed).

Manjaros openrc does provide a systemd free Arch, have built it and I know it works. Was talking too its developer about using there build tools. Kinda got enough projects at the moment so have not had the time.


Comments, suggestions, donations please feel free to contact me mrgreen(at)archbang(dot)org Artix information https://artixlinux.org/migrate.php

Offline

#40 2015-04-25 08:50:22

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

Re: Runit-init under Arch Linux

Have got some interesting news, currently running void-runit under archlinux, systemd free using openrc-eudev repo. Screenshots and output to follow.

Not broke it yet!

2015_04_25_175819_1920x1080_scrot.jpg

It does need some work to get running but nothing major. A couple of paths changes addition of dbus service to get things running. run files are quite easy to find or write.

Some package highlights are:

eudev-systemdcompat [pulls in eudev]
dbus-nosystemd
xorg-xwrapper [need to get X running correctly]
consolekit & of course polkit

Have tried many times to get runit working under Arch. Most of my Virtual machines failed with various ldconfig errors. Using [openrc-eudev] repo has made things so much easier. Went with runit-musl from aur which installs runit-init in /usr/bin which you can switch between runit and systemd to get things up and running if need be.

More than welcome to share any knowledge I have gained with others who wish to try runit....

Running i3 for testing, openbox works with lxdm and network manager (including applet)


Comments, suggestions, donations please feel free to contact me mrgreen(at)archbang(dot)org Artix information https://artixlinux.org/migrate.php

Offline

#41 2015-04-28 10:12:03

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

Re: Runit-init under Arch Linux

Thanks Mr Green, that link was definitely useful. I have slim + openbox etc etc running under a void style runit with my mkinitcpio-nosystemd things are peachy. I did the openrc-base openrc-desktop install and then the eudev-openrc eudev-systemdcompat install route. I already had an runit installed and working so things proceeded fairly well. I seem to have lost control of the hostname with my runit; I guess I need to run hostname early on to grab the name from /etc/hostname. Definitely getting there.

runit─┬─runsvdir─┬─3*[runsv───agetty]
      │          ├─runsv───sshd───sshd───sshd───bash───pstree
      │          ├─runsv───login───bash───slim───Xorg
      │          └─runsv───dhcpcd
      └─udevd

Offline

#42 2015-04-28 11:16:45

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

Re: Runit-init under Arch Linux

In void-runit you can add it too rc.conf... it should use /etc/hostname by default... I find the void scripts really easy to work with. Much easier than openrc (my opinion only). Where did you get mkinitcpio-nosystemd from?

[mrgreen@runit ~]$ pstree
runit─┬─VBoxClient───VBoxClient───{MONITOR}
      ├─at-spi-bus-laun─┬─dbus-daemon
      │                 ├─{gdbus}
      │                 └─{gmain}
      ├─at-spi2-registr───{gdbus}
      ├─console-kit-dae─┬─{gdbus}
      │                 ├─{gmain}
      │                 ├─{vt_thread_start}
      │                 └─{writer_thread_s}
      ├─dbus-daemon
      ├─dbus-launch
      ├─2*[gnome-keyring-d───{gmain}]
      ├─polkitd─┬─{JS GC Helper}
      │         ├─{JS Sour~ Thread}
      │         ├─{gdbus}
      │         ├─{gmain}
      │         └─{runaway-killer-}
      ├─runsvdir─┬─6*[runsv───agetty]
      │          ├─runsv───dbus-daemon
      │          ├─runsv───lxdm-binary─┬─Xorg
      │          │                     └─lxdm-session───openbox───lxterminal─┬─bash───pstree
      │          │                                                           ├─gnome-pty-helpe
      │          │                                                           └─{gmain}
      │          └─runsv───NetworkManager─┬─dhclient
      │                                   ├─{NetworkManager}
      │                                   ├─{gdbus}
      │                                   └─{gmain}
      ├─sh───tint2
      ├─sh───spacefm
      ├─sh───nm-applet───{gdbus}
      ├─sh───volumeicon
      └─udevd

Comments, suggestions, donations please feel free to contact me mrgreen(at)archbang(dot)org Artix information https://artixlinux.org/migrate.php

Offline

#43 2015-04-28 12:43:50

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

Re: Runit-init under Arch Linux

If anyone wants to have a go with void-runit under Arch, created a quick PKGBUILD... I do need to modify some of the scripts (mainly paths)

   
# Maintainer: mrgreen <mrgreen@archbang.org>
# quick and dirty pkgbuild to build void-runit scripts as an
# Archlinux package
#
# Not fully completed so use with caution

# copyright see
# http://creativecommons.org/publicdomain/zero/1.0/

pkgname=void-runit
pkgver=245.2ba8f93
pkgrel=1
pkgdesc='Void linux runit init scripts'
url="www.voidlinux.eu"
license=('GPL3')
arch=('any')
source=("$pkgname::git+https://github.com/voidlinux/void-runit")
sha256sums=('SKIP')
# most of depends are not needed, they're present only for clarity
depends=()
makedepends=('git')
optdepends=('sudo: install and update packages as non-root'
            'customizepkg: apply customizepkg modifications')
provides=('void-runit')
conflicts=()

build() {
  true
}

pkgver() {
  cd "$pkgname"
  echo "$(git rev-list --count HEAD).$(git rev-parse --short HEAD)"
}

package() {
  cd "$srcdir/$pkgname"
    make
    make DESTDIR="$pkgdir/" install
}

The best way to test and try out runit is too build a virtual machine under virtualbox... I will add instructions soon, for those who just want to get it booting add init=/sbin/runit-init too kernel line.



Add /sbin/runit-init too your kernel line and you should be able to boot to a console login.


Comments, suggestions, donations please feel free to contact me mrgreen(at)archbang(dot)org Artix information https://artixlinux.org/migrate.php

Offline

#44 2015-04-28 13:42:25

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

Re: Runit-init under Arch Linux

Mr Green wrote:

In void-runit you can add it too rc.conf... it should use /etc/hostname by default... I find the void scripts really easy to work with. Much easier than openrc (my opinion only). Where did you get mkinitcpio-nosystemd from?
.....

I made my own PKGBUILD diff from Arch is

$ diff PKGBUILD ~/devel/rgb-aur/mkinitcpio-nosystemd/PKGBUILD 
1c1
< # $Id$
---
> # based on the PKGBUILD from core mkinitcpio by
5c5
< pkgname=mkinitcpio
---
> pkgname=mkinitcpio-nosystemd
18a19,21
> makedepends=('asciidoc')
> provides=("mkinitcpio=${pkgver}-${pkgrel}")
> conflicts=('mkinitcpio')
20c23
< source=("https://sources.archlinux.org/other/$pkgname/$pkgname-$pkgver.tar.gz"{,.sig}
---
> source=("https://sources.archlinux.org/other/${pkgname%-nosystemd}/${pkgname%-nosystemd}-$pkgver.tar.gz"{,.sig}
27a31,43
>   local d=${srcdir}/${pkgname}-${pkgver}
>   [ ! -h "$d" ] && ln -s ${pkgname%-nosystemd}-${pkgver} "$d"
>   [ ! -d "$d" ] && echo "!!!!! cannot locate dir '$d'" && exit 666
>   sed -i -e"s/\s*'systemd'\s*//g" ${d}/PKGBUILD
>   rm -rf ${d}/install/sd-vconsole ${d}/install/sd-shutdown ${d}/systemd ${d}/tmpfiles
> echo 'Makefile' >/dev/tty
>   sed -i -e'/shutdown\.target\.wants/d
> /tmpfiles\.d/d
> /mkinitcpio-generate-shutdown-ramfs\.service/d
> ' ${d}/Makefile
> echo 'init_functions' >/dev/tty
>   sed -i -e'/# ensure that root.*systemd/,/\sfi\s*$/d
> s/logic of systemd/sd/' ${d}/init_functions
32c48
<   make -C "$pkgname-$pkgver" DESTDIR="$pkgdir" install
---
>   make -C "${pkgname}-$pkgver" DESTDIR="$pkgdir" install

I guess I should create a bitbucket repo to hold this sort of thing.

Offline

#45 2015-04-28 14:01:14

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

Re: Runit-init under Arch Linux

Would be cool smile

If you do get a PKGBUILD I would be interested in testing it.....


Comments, suggestions, donations please feel free to contact me mrgreen(at)archbang(dot)org Artix information https://artixlinux.org/migrate.php

Offline

Board footer

Powered by FluxBB