Artix Linux Forum

Init systems => runit => Topic started by: aleksey on 25 April 2021, 23:13:23

Title: [SOLVED] 🍇 elogind-runit shows error if it starts before dbus
Post by: aleksey on 25 April 2021, 23:13:23
Hi everyone. I am started to use runit and stumbled upon little visual issue. Sometimes during boot appears "bus-manager: could not connect to the system bus (Could not connect: No such file or directory)". As far as I know it's just a noise because after half a second elogind tries to start again. After adding little delay of 1 sec issue seems gone. Since package elogind-runit could be updated I just added simple shell script(with sleep 1 and +x permission ofc) to /etc/runit/sv/elogind/control/u. I think it worth a change because most display managers have delay of 1 sec anyway.

I hope package maintainer will see it. Cheers.
Title: Re: 🍇 elogind-runit shows error if it starts before dbus
Post by: Dudemanguy on 25 April 2021, 23:56:19
Adding random sleeps to init scripts is one of those things everyone (rightfully) hates. :P Runit doesn't really have service management capabilities so races like this aren't exactly solvable. That said, it does check if dbus is up before trying to start elogind but there's a bit of a delay between when the dbus daemon starts and when it is actually ready to receive messages. Hence why you get that message.
Title: Re: 🍇 elogind-runit shows error if it starts before dbus
Post by: aleksey on 27 April 2021, 13:53:12
Adding random sleeps to init scripts is one of those things everyone (rightfully) hates. :P Runit doesn't really have service management capabilities so races like this aren't exactly solvable. That said, it does check if dbus is up before trying to start elogind but there's a bit of a delay between when the dbus daemon starts and when it is actually ready to receive messages. Hence why you get that message.

Makes sense. I found why it doesn't work right. There mistake in dbus check script(/etc/runit/sv/dbus/check).

            There: exec dbus-send --system / org.desktop.DBus.Peer.Ping >/dev/null 2>&1
It should be: exec dbus-send --system / org.freedesktop.DBus.Peer.Ping >/dev/null 2>&1

Otherwise: "Error org.freedesktop.DBus.Error.UnknownMethod: Method "Ping" with signature "" on interface "org.desktop.DBus.Peer" doesn't exist"

I don't see elogind errors anymore. Now everything as it should and without any sleep.
Title: Re: 🍇 elogind-runit shows error if it starts before dbus
Post by: konimex on 27 April 2021, 15:08:43
Alright. I've fixed the DBus check script, it should be in [system] now.