<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="http://dev1galaxy.org/extern.php?action=feed&amp;tid=7802&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Dev1 Galaxy Forum / An unofficial Guide to runit on Debian-derived distros]]></title>
		<link>http://dev1galaxy.org/viewtopic.php?id=7802</link>
		<description><![CDATA[The most recent posts in An unofficial Guide to runit on Debian-derived distros.]]></description>
		<lastBuildDate>Sat, 14 Feb 2026 16:23:34 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Re: An unofficial Guide to runit on Debian-derived distros]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=62187#p62187</link>
			<description><![CDATA[<p>Hi Mercury,</p><p>thanks for the guide! as it was said in other posts I haven&#039;t found yet the time to write a comprehensive guide/documentation to runit, for several reason:<br />time constrains of course, but also parts of the runit debian integration are still under development and I prefer to finish before writing a guide (it will be obsolete soon otherwise).<br />I try to keep manpages up to date though, so I suggest reading</p><div class="codebox"><pre><code>man invoke-run
man update-service
man cpsv</code></pre></div><p>Also I try to keep README files in runit and runit-servics packages up to date</p><div class="quotebox"><blockquote><div><p>/usr/share/doc/runit/README-*<br />/usr/share/doc/runit-services/README.gz</p></div></blockquote></div><p>If not installed by default (not sure), I suggest to install apt-listchanges package<br />to read the NEWS during the upgrade (I do write NEWS when there are important changes)</p><p>that said let me add few comments on top of your guide:</p><div class="quotebox"><blockquote><div><p>/etc/sv/<br />Contains installed (but not necessarily enabled) local services. Services installed and managed by the local admin and/or manually converted from other init systems (systemd, sysVinit) should exist here. Enabled services should be the targets of symbolic links in /etc/runit/runsvdir/default/ (see above)</p></div></blockquote></div><p>this is correct and is the desired end state, however there are still packages (getty-run, openssh-server, acpid, tor, irqbalance and few others)<br />that are using the legacy layout and install the service directory directly in /etc/sv/ (without metafiles, the legacy runit-helper is used instead of trigger_sv): I still have to organize the transition.</p><div class="quotebox"><blockquote><div><p>This important behavior lacks official documentation. At boot time, a service sync occurs.</p></div></blockquote></div><p>be aware that, as the name may suggest, trigger_sv run as a dpkg trigger at the end of each apt operation (install/remove/upgrade), so the sync happens at runtime; then a sync was added to stage 2 to ensure that the first time you boot runit after an init-switch (sysvinit --&gt; runit-init) the state of services is synched with defaults.<br />At runtime the trigger loop takes care of enable/disable services, but it also runs the second (&quot;upgrade&quot;) loop that make sure that running services are restarted (or reloaded) when their binary is upgraded.<br />The upgrade loop is very important for security: if the running instance is not upgraded it may still be affected by CVEs while the package changelog claims the issue is fixed..</p><div class="quotebox"><blockquote><div><p>There is no intended configurable way to override this behavior globally for all services, and there is no intended configurable way to prevent the runtime copies from being created. However, the following methods will work:</p><p>To disable all service sync and auto-enable behavior, edit /etc/runit/2 and comment out the call to /usr/lib/runit/trigger_sv. Be aware that a future update of runit is likely to erase this change and it will have to be re-applied.</p></div></blockquote></div><p>/etc/runit/2 is a conffile so dpkg will ask at upgrade if you want to keep your version or want to use the package version, no automatic overwrite will happen: but this wont stop the runtime dpkg trigger invocation.</p><p>If you want to override something (including metafiles) inside a service directory that is in /usr/share/runit/sv.current , the intended way is<br />create a copy in /etc/sv/ and maintain it by yourself (it won&#039;t be automatically overwirtten at upgrades, and there is no dpkg prompt so you have to import bugfixes by yourself).</p><p>(better if runit &gt;= 2.2.0-7 is used for this)<br />As example for cron, you can do<br />(make sure there is no /etc/sv/cron dir first)</p><div class="codebox"><pre><code>#cpsv p cron</code></pre></div><p>than you can remove any symlink and replace it with a real file that includes your changes<br />to inspect the diff later you can do</p><div class="codebox"><pre><code>#cpsv d cron</code></pre></div><p>if you want to override *all* services dir in /usr/share/runit/sv.current then writing copies in /etc/sv/ is no longer practical: the metafiles interface and cpsv are designed to allow to roll your local/private collection in place of services provided by packages, but I haven&#039;t tested this myself yet and the operation is dangerous if done at runtime (if a directory disappear from runsvdir directory, the service is stopped, so guess what can happen if you switch the target of symlinks in /usr/share/runit/ the wrong way..) so I won&#039;t document it here for now.</p><p>Best,<br />Lorenzo</p>]]></description>
			<author><![CDATA[dummy@example.com (Lorenzo)]]></author>
			<pubDate>Sat, 14 Feb 2026 16:23:34 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=62187#p62187</guid>
		</item>
		<item>
			<title><![CDATA[Re: An unofficial Guide to runit on Debian-derived distros]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=62061#p62061</link>
			<description><![CDATA[<p>Thanks for this. Runit service implementation in Debian-based distros is still severely lacking compared to other distros such as Void or Artix. Devuan&#039;s implementation simply adds a coat of paint over the already existing SysVinit services.</p>]]></description>
			<author><![CDATA[dummy@example.com (brocashelm)]]></author>
			<pubDate>Tue, 10 Feb 2026 20:29:27 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=62061#p62061</guid>
		</item>
		<item>
			<title><![CDATA[An unofficial Guide to runit on Debian-derived distros]]></title>
			<link>http://dev1galaxy.org/viewtopic.php?pid=62060#p62060</link>
			<description><![CDATA[<h5>About this guide</h5><p>This guide is intended to describe the behavior, use, and configuration of the runit init system on Debian-descended Linux distributions, including Devuan and its derivatives. It exists because important parts of the official runit documentation are misleadingly incomplete or outright wrong as applied to the version of runit packaged for Debian and its descendants.</p><p>This guide is a best-effort, based on hobbyist-level analysis. It may, and probably does, contain material errors. This guide is current as of January 2026, and applies to runit version 2.2.0 and runit-services version 0.10.1 as available in the Debian package repositories. This guide comes with no warranty whatsoever. Copying of this content, in part or in whole, with or without modification, is permitted and encouraged, and no attribution is required. This guide is licensed under the <a href="http://wtfpl.net/txt/copying/" rel="nofollow">WTFPL version 2 or any later version</a></p><h5>Directories</h5><p>Runit service files are stored as follows. ( 🔗︎ indicates a symbolic link)</p><p><span class="bbc">/etc/service/</span> 🔗︎ <span class="bbc">/etc/runit/runsvdir/current/</span> 🔗︎ <span class="bbc">/etc/runit/runsvdir/default/</span><br />Contains the currently active (enabled) services. Runit will react immediately to the creation or removal of items here. In a typical installation, most items in this directory will be symbolic links to <span class="bbc">/usr/share/runit/sv.now/</span> or to <span class="bbc">/etc/sv/</span>, but links to services located elsewhere are also possible and will function as long as the service is properly defined at the target</p><p><span class="bbc">/etc/sv/</span><br />Contains installed (but not necessarily enabled) local services. Services installed and managed by the local admin and/or manually converted from other init systems (systemd, sysVinit) should exist here. Enabled services should be the targets of symbolic links in <span class="bbc">/etc/runit/runsvdir/default/</span> (see above)</p><p><span class="bbc">/usr/share/runit/sv.current/</span> 🔗︎ <span class="bbc">/usr/share/runit/sv.now/</span><br />Contains installed (but not necessarily enabled) stock services, that is, those installed by packages and managed automatically. Services existing here are “runtime copies” pulled from <span class="bbc">/usr/share/runit/sv.src/</span> (see below) when certain conditions are met to make them available for use. Enabled services should be the targets of symbolic links in <span class="bbc">/etc/runit/runsvdir/default/</span> (see above)</p><p><span class="bbc">/usr/share/runit/sv.src/</span> 🔗︎ <span class="bbc">/usr/share/runit/sv/</span><br />Contains stock service definitions provided by packages. This directory is an extensive library of items only some of which apply to the current OS configuration. In general, these will never be the targets of symbolic links in <span class="bbc">/etc/runit/runsvdir/default/</span>. When certain conditions are met, indicating that specific services should be enabled, they will be automatically copied to <span class="bbc">/usr/share/runit/sv.now/</span> and the symbolic links in <span class="bbc">/etc/runit/runsvdir/default/</span> will be created ro enable them (see the section “<strong>Service Sync</strong>” below)</p><h5>Service Sync &amp; Service Auto-enable</h5><p>This important behavior lacks official documentation. At boot time, a service sync occurs. </p><p>Services available in <span class="bbc">/usr/share/runit/sv.src/</span> are checked, and if they are applicable to the currently configured OS, they will be synced via a copy operation to <span class="bbc">/usr/share/runit/sv.now/</span> where they are known as “runtime copies” and are considered properly installed. By default, they will then be automatically enabled by creating symbolic links in <span class="bbc">/etc/runit/runsvdir/default/</span> targeting the runtime copies (along with local services in <span class="bbc">/etc/sv/</span>.)</p><p>Services are considered applicable if they include a <span class="bbc">/usr/share/runit/sv.src/${servicename}/.meta/bin</span> file containing the name of an executable program present on the current OS configuration. If the service definition does not contain this file, or if the executable program referenced by it does not exist, then the service is presumed to be inapplicable and a runtime copy will not be created.</p><p>If the service definition in <span class="bbc">/usr/share/runit/sv.src/</span> is removed, there will be no effect on already-installed services in <span class="bbc">⋯/sv.now/</span>.</p><p>If the executable program referred to by the service <span class="bbc">⋯/.meta/bin</span> file is removed, the service will be automatically disabled at next boot by removing its symbolic link in <span class="bbc">⋯/default/</span>, however the runtime copy in <span class="bbc">⋯/sv.now/</span> will not be affected and will remain installed for potential future use.</p><p>This process is controlled by the helper script <span class="bbc">/usr/lib/runit/<strong>trigger_sv</strong></span>, which is called directly from runit level 2 (<span class="bbc">/etc/runit/2</span>) at each boot. <span class="bbc">trigger_sv</span> further calls <strong><span class="bbc"><a href="https://manpages.debian.org/-/runit/cpsv.8.en.html" rel="nofollow">cpsv</a></span></strong> to sync services (selectively copy from <span class="bbc">⋯/sv.src/</span> to <span class="bbc">⋯/sv.now/</span>), then automatically enables installed services (in <span class="bbc">⋯/sv.now/</span> and in <span class="bbc">/etc/sv/</span>) by creating links in <span class="bbc">⋯/default/</span>.</p><p>To override auto-enable behavior for a specific service, create a symbolic link in <span class="bbc">⋯/default/</span>, matching the name of the service with the addition of a leading dot, and remove the regular service link if it exists. For example, to disable the <em>cron</em> service, create the symbolic link <span class="bbc">/etc/runit/runsvdir/default/.cron</span> 🔗︎ <span class="bbc">/usr/share/runit/sv.now/cron</span> and delete the symbolic link <span class="bbc">/etc/runit/runsvdir/default/cron</span> 🔗︎ . These actions can be performed in one command using the <strong><span class="bbc"><a href="https://manpages.debian.org/-/runit/update-service.8.en.html" rel="nofollow">update-service</a></span></strong> utility. See the section “<strong>Disabling and Enabling Services</strong>” below for more details.</p><p>There is no intended configurable way to override auto-enable behavior globally for all services, and there is no intended configurable way to prevent the runtime copies from being created. However, the following methods will work:</p><p>To disable all service sync and auto-enable behavior <em>at boot time</em>, edit <span class="bbc">/etc/runit/2</span> and comment out the call to <span class="bbc">/usr/lib/runit/trigger_sv</span>. Note that <span class="bbc">trigger_sv</span> may still be automatically called as a dpkg <a href="https://man7.org/linux/man-pages/man5/deb-postinst.5.html" rel="nofollow">postinst</a> <a href="https://man7.org/linux/man-pages/man5/deb-triggers.5.html" rel="nofollow">trigger</a> during <span class="bbc">apt</span> operations.</p><p>To disable the service sync only, but keep the auto-enable behavior, create a symbolic link <span class="bbc">/etc/runit/atomic.upgrade</span> to target <span class="bbc">/usr/bin/true</span>. <span class="bbc">trigger_sv</span> will call <span class="bbc">atomic.upgrade</span> preferentially over <span class="bbc">cpsv</span>. This method may also be used to link to a script with custom service sync/copy logic that works with a curated list of services or performs more complex operations. Note that <span class="bbc">atomic.upgrade</span> <em>must</em> target an executable file to be effective.</p><h5>SysVinit Emulation</h5><p>This important behavior lacks official documentation. </p><p>Runit will automatically start sysVinit services enabled at runlevel 2 (those in <span class="bbc">/etc/rc2.d/</span>), if a runit service with the same name is <em>not</em> installed. The purpose is to maintain a reasonably functional system by using sysVinit services for which runit variants are not available or installed. The emulation logic checks for installed runit services in <span class="bbc">/usr/share/runit/sv.current</span> and <span class="bbc">/etc/sv/</span> and enabled services in <span class="bbc">/etc/service/</span> to determine if a runit service with a matching name exists.</p><p>If both a sysVinit and runit service with the same name exist, the sysVinit service will not be started, regardless of whether the runit service is currently enabled. This means that if the user installs a runit service and disables it, the logic presumes that the user wants the service disabled altogether, and the sysVinit alternative is not desired. If the runit service is enabled, it will be used preferentially over its sysVinit variant.</p><p> This process is controlled by the helper script <span class="bbc">/lib/runit/run_sv_scripts</span>, which is called directly from runit level 2 (<span class="bbc">/etc/runit/2</span>) at each boot.</p><p>The following files can be used to override the default behavior described above. The files do not require any content. Only their existence is checked by the script logic.</p><p><span class="bbc">/etc/runit/no.emulate.sysv</span><br />This file will disable sysVinit emulation completely.</p><p><span class="bbc">/etc/runit/override-sysv.d/${servicename}.block</span><br />This file, matching the name of the service with the addition of a .block extension, will disable the emulation of that specific sysVinit service in all cases, even if a matching runit service does not exist.</p><p><span class="bbc">/etc/runit/override-sysv.d/${servicename}.sysv</span><br />This file, matching the name of the service with the addition of a .sysv extension, will enable the emulation of that specific sysVinit service in all cases, even if a matching runit service (whether disabled or enabled) exists.</p><p>Note: A bug in runit-services versions 0.10.0 and earlier may cause a sysVinit service to start even when the matching runit service is installed and enabled, and even when a <span class="bbc">.block</span> file is present for that service, which may cause unpredictable or buggy behavior. This has been observed to occur with login managers such as slim, causing login loops. This is caused by faulty script logic in <em>dbus.dep-fixer</em>, included in the runit-services package. This bug <a href="https://salsa.debian.org/debian/runit-services/-/commit/5fef4818c0259e228a1b432a92f6af90e6c5f575" rel="nofollow">was corrected</a> in runit-services version 0.10.1.</p><h5>Disabling and Enabling Services</h5><p>Official runit documentation states that simply deleting the service&#039;s symbolic link within <span class="bbc">/etc/runit/runsvdir/default/</span> will disable the service. However, because of the auto-enable behavior described in the “<strong>Service Sync &amp; Service Auto-enable</strong>” section, this change will not persist across reboots for any services located in <span class="bbc">/etc/sv/</span> or in <span class="bbc">/usr/share/runit/sv.now/</span> (which together typically comprise almost all runit services). Deleting the link in <span class="bbc">⋯/default/</span> in that case will disable the service only for the current session, and the service will be automatically re-enabled at next boot. </p><p>This does not apply to services located outside those two standard directories.</p><p>The auto-enable behavior will be inhibited by the presence of a symbolic link in <span class="bbc">⋯/default/</span> matching the name of the service with the addition of a leading dot. For example, <span class="bbc">/etc/runit/runsvdir/default/.cron</span> 🔗︎&#160; will disable the cron service, and this effect will persist across reboots. Note that this file <em>must</em> be a valid symbolic link, and its target <em>must</em> be a directory to have the proper effect. Typically, the link targets the directory of the disabled service, but this is not strictly necessary, and linking to an empty dummy directory may be used to pre-emptively disable (or “blacklist”) a service before it is installed.</p><p>Runit will not start any service only linked by a dotfile in <span class="bbc">⋯/default/</span>, but if (for whatever reason) both a dotfile <em>and</em> regular symbolic link for a particular service exist there, then that service <em>will</em> start. Such a situation is typically the result of an error and may be regarded as a misconfiguration.</p><p>In general, directly adding, removing, or modifying the links in <span class="bbc">/etc/runit/runsvdir/default/</span> is not recommended. Debian-packaged runit provides the <strong><span class="bbc"><a href="https://manpages.debian.org/-/runit/update-service.8.en.html" rel="nofollow">update-service</a></span></strong> command-line utility to manage services. This utility will manage symbolic links in <span class="bbc">⋯/default/</span> and make other changes to persist service status. </p><p><strong>Quick reference:</strong></p><p>To enable/disable a service:<br /><span class="bbc">update-service --add <em>service-directory</em></span><br /><span class="bbc">update-service --remove <em>service-directory</em></span><br />These commands will, respectively, add and remove a service from runit supervision. This is accomplished by the creation and deletion of the appropriate symbolic links in <span class="bbc">/etc/runit/runsvdir/default/</span>, as described above.</p><p>To set default service state:<br /><span class="bbc">update-service --auto <em>service-directory</em></span><br /><span class="bbc">update-service --noauto <em>service-directory</em></span><br />These commands will set the service to, respectively, started (“up”) and stopped (“down”) at system boot. By default any installed services are automatically started at boot time unless they have been marked not to be. This is accomplished by placing a <span class="bbc">down</span> file within the service directory. The existence of this file indicates to runit that the service should not be auto-started at boot.</p><p>In any of the above commands, <span class="bbc"><em>service-directory</em></span> may be the full path to the service or only the basename (final part of the path; typically equal to the name of the service). In the latter case, the directories <span class="bbc">/etc/sv/</span> and <span class="bbc">/usr/share/runit/sv.now/</span> are searched, in that order, for the service, and the command is applied to the first one found.</p><p>See the <a href="https://manpages.debian.org/-/runit/update-service.8.en.html" rel="nofollow">manual page</a> for more information.</p><h5>Tips and Tricks</h5><p>•&#160; &#160;To increase runit logging verbosity, create the file <span class="bbc">/etc/runit/verbose</span>. This file does not require any content. Only its existence is checked. Runit logs its boot-time output to <span class="bbc">/var/log/boot</span>.</p><p>•&#160; &#160;To list all enabled runit services <em>and</em> their paths, use this command:<br /><span class="bbc">for svc in $(update-service --list);&#160; do update-service --list $svc; done</span><br />There is currently no way to get this output from a single invocation of <span class="bbc">update-service</span>, so the for-loop is necessary.</p><p>[More content to be added]</p>]]></description>
			<author><![CDATA[dummy@example.com (Mercury)]]></author>
			<pubDate>Tue, 10 Feb 2026 19:27:28 +0000</pubDate>
			<guid>http://dev1galaxy.org/viewtopic.php?pid=62060#p62060</guid>
		</item>
	</channel>
</rss>
