<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="https://dev1galaxy.org/extern.php?action=feed&amp;tid=4933&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Dev1 Galaxy Forum / Runit and backwards compatibility]]></title>
		<link>https://dev1galaxy.org/viewtopic.php?id=4933</link>
		<description><![CDATA[The most recent posts in Runit and backwards compatibility.]]></description>
		<lastBuildDate>Mon, 14 Mar 2022 14:21:21 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Re: Runit and backwards compatibility]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=35200#p35200</link>
			<description><![CDATA[<div class="quotebox"><blockquote><div><p>(Ah! does &#039;wip&#039; stand for &#039;work in progress&#039;, so that it doesn&#039;t match the real name?)</p></div></blockquote></div><p>Exactly <img src="https://dev1galaxy.org/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><div class="codebox"><pre><code>As for a dependency, I see that the Man page for sv says that sv start is the same as sv up but that it waits for the command to take effect, calling the check script if present. This would seem to mean that sv start dbus is the same as sv up dbus &amp;&amp; sv check dbus. I assume that the || exit 1 will cause Runit to recognise that the dependency has not started and retry later (1s ?).</code></pre></div><p>Yes, that&#039;s the idea. </p><div class="quotebox"><blockquote><div><p>and have a check file :-</p><div class="codebox"><pre><code>#!/bin/sh
exec dbus-send --system / org.freedesktop.DBus.Peer.Ping &gt; /dev/null 2&gt; /dev/null</code></pre></div></div></blockquote></div><p>the one that I linked in salsa.debian.org does</p><div class="codebox"><pre><code>#!/bin/sh

test -S /var/run/dbus/system_bus_socket &amp;&amp; exit 0

exit 1</code></pre></div><p>both are fine according to my testing</p><div class="quotebox"><blockquote><div><p>Thank you for all of your work on Runit.</p></div></blockquote></div><p>&#160; <img src="https://dev1galaxy.org/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>Reports from tinkerers and users are very helpful to improve the package but sadly I get very few on Debian..<br />Also I read this forum rarely, so consider to use</p><div class="codebox"><pre><code>reportbug runit</code></pre></div><p>or send a ping if you want me to join a discussion</p><p>Lorenzo</p>]]></description>
			<author><![CDATA[dummy@example.com (Lorenzo)]]></author>
			<pubDate>Mon, 14 Mar 2022 14:21:21 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=35200#p35200</guid>
		</item>
		<item>
			<title><![CDATA[Re: Runit and backwards compatibility]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=35195#p35195</link>
			<description><![CDATA[<p>It would appear that the links to, e.g. <a href="https://salsa.debian.org/runit-team/runit-services/-/tree/next" rel="nofollow">https://salsa.debian.org/runit-team/run … /tree/next</a> do not work from Pale Moon,<br />but do work from Falkon.</p><p>Edit: and it works in Chromium.</p><p>Geoff</p>]]></description>
			<author><![CDATA[dummy@example.com (Geoff 42)]]></author>
			<pubDate>Mon, 14 Mar 2022 11:52:03 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=35195#p35195</guid>
		</item>
		<item>
			<title><![CDATA[Re: Runit and backwards compatibility]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=35190#p35190</link>
			<description><![CDATA[<p>Lorenzo!</p><p>thank you for your detailed response to my comments.</p><p>Before I get onto the details, might I ask about the <span class="bbc">salsa.debian.org</span> URL,<br />as it opens, but does not display the actual content for me. Does it need me to create an account?</p><p>The situation with /etc/sv versus /etc/service is interesting and may depend on your<br />point of view. I am currently working through services and converting them from SysV to Runit.<br />Therefore, I would like the SysV service to keep running until I have the Runit version correctly<br />set up, in which case the use of /etc/service seems to work better for me. But I accept your<br />point about disabling a service, once everything is set up.</p><div class="quotebox"><blockquote><div><p>just use &#039;servicename-wip&#039; and keep it disabled by default untill your service is ready for use.</p></div></blockquote></div><p>I&#039;m sorry, but I don&#039;t understand the bit about &#039;servicename-wip&#039;. (Ah! does &#039;wip&#039; stand for &#039;work in progress&#039;, so that it doesn&#039;t match the real name?)</p><p>As for a dependency, I see that the Man page for sv says that <span class="bbc">sv start</span> is the same as <span class="bbc">sv up</span> but that it waits for the command to take effect, calling the <span class="bbc">check</span> script if present. This would seem to mean that <span class="bbc">sv start dbus</span> is the same as <span class="bbc">sv up dbus &amp;&amp; sv check dbus</span>. I assume that the <span class="bbc">|| exit 1</span> will cause Runit to recognise that the dependency has not started and retry later (1s ?).</p><p>I have used the <span class="bbc">run</span> line :-</p><div class="codebox"><pre><code>exec dbus-daemon --system --nofork --nopidfile</code></pre></div><p>and have a <span class="bbc">check</span> file :-</p><div class="codebox"><pre><code>#!/bin/sh
exec dbus-send --system / org.freedesktop.DBus.Peer.Ping &gt; /dev/null 2&gt; /dev/null</code></pre></div><p>I may have copied these from Void Linux.</p><p>Thank you for all of your work on Runit.</p><p>Geoff</p>]]></description>
			<author><![CDATA[dummy@example.com (Geoff 42)]]></author>
			<pubDate>Mon, 14 Mar 2022 10:49:44 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=35190#p35190</guid>
		</item>
		<item>
			<title><![CDATA[Re: Runit and backwards compatibility]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=35184#p35184</link>
			<description><![CDATA[<p>Hi Geoff 42,</p><p>The two problems that you identified are somehow real bug in the runit package, but</p><div class="quotebox"><blockquote><div><p>Replacing /etc/sv with /etc/service in /lib/runit/run_sysv_scripts did seem to have the expected result that disabling a service in Runit caused it to be started via /etc/rc2.d on a reboot.</p></div></blockquote></div><p>I don&#039;t think this is a correct solution: especially with runit as init, if a user disables a service, it should not start. A native disabled service on a runit system should definitely not start automatically at boot (even with a sysv instance); it may be different in a sysv system that uses runit as a service manager.<br />So the bug here is that for now, there is no tool for the sysadmin to tell the system to disable a service with runit and also with sysv (and any other init supported): it would be a job for update-rc.d, I already sent patches but they were rejected for several reason and the bug report is stuck. I plan to fix this in runit 2.1.2-46 or maybe -47.</p><div class="quotebox"><blockquote><div><p>I suspect the /etc/sv is not the correct directory to check against, as the services here have not necessarily been enabled and indeed, people like me may not have finished setting up a service!</p></div></blockquote></div><p>just use &#039;servicename-wip&#039; and keep it disabled by default untill your service is ready for use.</p><div class="quotebox"><blockquote><div><p>As mentioned earlier there seem to be 2 different versions of this</p><div class="codebox"><pre><code>sv start dbus</code></pre></div><p>or</p><div class="codebox"><pre><code>sv check dbus &gt;/dev/null || exit 1</code></pre></div></div></blockquote></div><p>According to my testing</p><div class="codebox"><pre><code>sv start dbus  ||  exit 1</code></pre></div><p>will do it, or alternatively you can</p><div class="codebox"><pre><code>sv up dbus  &amp;&amp;  sv check dbus  ||  exit 1</code></pre></div><p>but</p><div class="codebox"><pre><code>sv check dbus &gt;/dev/null || exit 1</code></pre></div><p> will not always work as expected, because if the requested status is down sv check can exit 0,<br />so before you use check make sure to set the wanted status</p><p>Also, of all dependencies, dbus is not easy to get it right, because there is a relevant time since when it reports itself as &#039;up&#039; and when<br />it actually finishes its initialization, so you need a check file, see<br /><a href="https://salsa.debian.org/runit-team/runit-services/-/blob/next/sv/dbus/check" rel="nofollow">https://salsa.debian.org/runit-team/run … dbus/check</a></p><p>Also if you use dbus from there be aware that the exec line of dbus should be</p><div class="codebox"><pre><code>exec dbus-daemon --system --nofork --nopidfile </code></pre></div><p>without chpst. It used to work with chpst but it&#039;s broken since a recent upgrade in Debian</p><div class="quotebox"><blockquote><div><p>The other problem is that the sequencing may be wrong. So that if you have dbus set up to be run by runit and avahi has not yet been done, then avahi will fail as it will be started by run_sysv_scripts before runsv starts dbus. I am not sure what the answer might be for this.</p></div></blockquote></div><p>Correct: my answer is to make native runit services available all at once, in a runit-services[1][2] package, especially services that are involved in a chain of dependency. Again, right now I&#039;m stuck there too, but I hope it will get a sponsor in future. If not I may also consider a Devuan package if Devuan Devs allow me.</p><p>[1] <a href="https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=986656" rel="nofollow">https://bugs.debian.org/cgi-bin/bugrepo … bug=986656</a><br />[2] <a href="https://salsa.debian.org/runit-team/runit-services/-/tree/next" rel="nofollow">https://salsa.debian.org/runit-team/run … /tree/next</a>&#160; &#160;(watch out, very experimental!)<br />[3] <a href="https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1005309" rel="nofollow">https://bugs.debian.org/cgi-bin/bugrepo … ug=1005309</a></p><p>Lorenzo</p>]]></description>
			<author><![CDATA[dummy@example.com (Lorenzo)]]></author>
			<pubDate>Sun, 13 Mar 2022 22:59:06 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=35184#p35184</guid>
		</item>
		<item>
			<title><![CDATA[Re: Runit and backwards compatibility]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=35182#p35182</link>
			<description><![CDATA[<p>With the services which are running under <span class="bbc">runsvdir</span>, I have tried indicating when they need another service to have been started. Thus I have :-<br /><span class="bbc">avahi-daemon, cups, ddclient, elogind</span><br />depending on <span class="bbc">dbus</span>.</p><p>As mentioned earlier there seem to be 2 different versions of this</p><div class="codebox"><pre><code>sv start dbus</code></pre></div><p>or</p><div class="codebox"><pre><code>sv check dbus &gt;/dev/null || exit 1</code></pre></div><p>I have seen messages in the logs where dbus fails to start correctly the first time, only to start correctly 1s later, thus :-</p><div class="quotebox"><blockquote><div><p>2022-03-11_18:11:17.33232 warning: dbus: unable to open supervise/ok: file does not exist<br />2022-03-11_18:11:17.34982 Found user &#039;avahi&#039; (UID 104) and group &#039;avahi&#039; (GID 111).<br />2022-03-11_18:11:17.34983 Successfully dropped root privileges.<br />2022-03-11_18:11:17.34983 avahi-daemon 0.8 starting up.<br />2022-03-11_18:11:17.34983 dbus_bus_get_private(): Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory<br />2022-03-11_18:11:17.34983 WARNING: Failed to contact D-Bus daemon.<br />2022-03-11_18:11:17.34983 avahi-daemon 0.8 exiting.<br />2022-03-11_18:11:18.33051 ok: run: dbus: (pid 2007) 1s<br />2022-03-11_18:11:18.33159 Found user &#039;avahi&#039; (UID 104) and group &#039;avahi&#039; (GID 111).<br />2022-03-11_18:11:18.33163 Successfully dropped root privileges.<br />2022-03-11_18:11:18.33173 avahi-daemon 0.8 starting up.<br />2022-03-11_18:11:18.33227 Successfully called chroot().</p></div></blockquote></div><p>This type of message is intermittent and was produced with</p><div class="quotebox"><blockquote><div><p>sv start dbus</p></div></blockquote></div><p>I will try it with</p><div class="quotebox"><blockquote><div><p>sv check dbus &gt;/dev/null || exit 1</p></div></blockquote></div><p>and see if that works better. I assume that this might suppress the warning message if it is redirected to /dev/null, but I will need to look out for the daemon failing and then trying again 1s later and succeeding.</p>]]></description>
			<author><![CDATA[dummy@example.com (Geoff 42)]]></author>
			<pubDate>Sun, 13 Mar 2022 16:33:15 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=35182#p35182</guid>
		</item>
		<item>
			<title><![CDATA[Re: Runit and backwards compatibility]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=35146#p35146</link>
			<description><![CDATA[<p>Replacing <span class="bbc">/etc/sv</span> with <span class="bbc">/etc/service</span> in <span class="bbc">/lib/runit/run_sysv_scripts</span> did seem to have the expected result that disabling a service in Runit caused it to be started via <span class="bbc">/etc/rc2.d</span> on a reboot.</p><p>If this service then failed to start correctly because of a sequencing problem, then adding e.g. :-</p><div class="codebox"><pre><code>sv start dbus</code></pre></div><p>to the file in rc2.d also failed, probably because <span class="bbc">runsvdir</span> had not been started yet,<br />causing the <span class="bbc">sv</span> command itself to fail.</p><p>It was possible to get <span class="bbc">avahi-daemon</span> to start correctly under Runit by adding the line :-</p><div class="codebox"><pre><code>sv start dbus</code></pre></div><p>to its <span class="bbc">run</span> file and the sequencing then worked as expected.</p>]]></description>
			<author><![CDATA[dummy@example.com (Geoff 42)]]></author>
			<pubDate>Thu, 10 Mar 2022 20:18:51 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=35146#p35146</guid>
		</item>
		<item>
			<title><![CDATA[Re: Runit and backwards compatibility]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=35142#p35142</link>
			<description><![CDATA[<p>I have now edited <span class="bbc">run_sysv_scripts</span> to to use <span class="bbc">/etc/service</span> instead of <span class="bbc">/etc/sv</span> and it has not broken anything yet, but I will need to check what happens when I disable services under Runit, etc.</p>]]></description>
			<author><![CDATA[dummy@example.com (Geoff 42)]]></author>
			<pubDate>Thu, 10 Mar 2022 11:23:24 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=35142#p35142</guid>
		</item>
		<item>
			<title><![CDATA[Re: Runit and backwards compatibility]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=35141#p35141</link>
			<description><![CDATA[<p>Thank you for your helpful observations.</p><p>I more or less copied the elogind run file from Void Linux. It starts :-</p><div class="codebox"><pre><code># elogind doesn&#039;t work right if it starts before dbus
sv check dbus &gt;/dev/null || exit 1</code></pre></div><p>which I assume will leave the elogind startup looping until dbus is running, while</p><div class="codebox"><pre><code>sv start dbus</code></pre></div><p>will hang until dbus is running. The latter sounds better. I suppose that that line could be included in an init.d script, although would that work if runsvdir has not been started yet?</p><p>Geoff</p>]]></description>
			<author><![CDATA[dummy@example.com (Geoff 42)]]></author>
			<pubDate>Thu, 10 Mar 2022 10:33:35 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=35141#p35141</guid>
		</item>
		<item>
			<title><![CDATA[Re: Runit and backwards compatibility]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=35138#p35138</link>
			<description><![CDATA[<p>Interesting observation. I see that the run script for network-manager starts dbus first, and the one for lightdm starts dbus and elogind. So I guess if you write a new run script, you have to make sure you start anything that&#039;s needed first. It doesn&#039;t seem to be a problem that multiple scripts have &#039;sv start dbus&#039; in them. </p><p>I think the obvious answer for now is that you gotta try it. See if you can break avahi and then fix it by editing /lib/runit/run_sysv_scripts to use /etc/service instead of /etc/sv.</p>]]></description>
			<author><![CDATA[dummy@example.com (fsmithred)]]></author>
			<pubDate>Wed, 09 Mar 2022 21:30:11 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=35138#p35138</guid>
		</item>
		<item>
			<title><![CDATA[Runit and backwards compatibility]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=35133#p35133</link>
			<description><![CDATA[<p>The Debian port of Runit has introduced some backwards compatibility, so that it can start services from <span class="bbc">/etc/init.d</span> if they are not yet set up for Runit. To do this it uses the script <span class="bbc">/lib/runit/run_sysv_scripts</span>.</p><p>This will look through the directory it has been passed (typically <span class="bbc">/etc/rcS.d</span> and <span class="bbc">/etc/rc2.d</span>) and it will run the scripts starting with &quot;S&quot; but only run them if they do not exist in <span class="bbc">/etc/sv</span>. It uses <span class="bbc">rcS.d</span> for stage 1 and <span class="bbc">rc2.d</span> for stage 2. This seems reasonable, but there are problems.</p><p>I would have thought that all of the services in <span class="bbc">rcS.d</span> would need to be started as the baseline for the system to be running and that they are probably not started by <span class="bbc">runsv</span>.</p><p>As for stage 2, it starts the scripts in <span class="bbc">rc2.d</span> if they are not in <span class="bbc">/etc/sv</span>. It then starts <span class="bbc">runsvdir</span>, which starts the services set up to run under Runit. There are two problems here. I suspect the <span class="bbc">/etc/sv</span> is not the correct directory to check against, as the services here have not necessarily been enabled and indeed, people like me may not have finished setting up a service! I suspect that it may be better to check against <span class="bbc">/etc/service</span> rather than <span class="bbc">/etc/sv</span>, as those are the ones which have been enabled.</p><p>The other problem is that the sequencing may be wrong. So that if you have <span class="bbc">dbus</span> set up to be run by runit and <span class="bbc">avahi</span> has not yet been done, then <span class="bbc">avahi</span> will fail as it will be started by <span class="bbc">run_sysv_scripts</span> before <span class="bbc">runsv</span> starts <span class="bbc">dbus</span>. I am not sure what the answer might be for this.</p>]]></description>
			<author><![CDATA[dummy@example.com (Geoff 42)]]></author>
			<pubDate>Wed, 09 Mar 2022 16:46:41 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=35133#p35133</guid>
		</item>
	</channel>
</rss>
