Information question on how to usefully use runit.

That's what I thought because I've used Void Linux. What purpose would it serve in FreeBSD? FreeBSD has an init system. I suppose you could replace it but I am not knowledgeable enough to know why you would want to.
 
We are all locked down so why not?

There are two (2) runit:

sysutils/runit : said to be a "Replacement for DJB daemontools" (hereafter referred to as "runit")

and

sysutils/runit-faster : said to be a "Runit based init replacement for FreeBSD" (hereafter referred to as "runit-faster")

runit-faster (that's your wild goose) is directly based on the Void Linux Init system. You will find a how-to here, complemented with that.

However, before you start your chase, please read this.

My two cents.
 
I never tried it, but I have to ask: what should this accomplish, and how does it integrate with an ecosystem where all the init-scripts are written in the "mewburn" way? Does it come with replacements for all the scripts in /etc/rc.d? And what about ports installing their scripts to /usr/local/etc/rc.d?
 
I never tried it, but I have to ask: what should this accomplish, and how does it integrate with an ecosystem where all the init-scripts are written in the "mewburn" way? Does it come with replacements for all the scripts in /etc/rc.d? And what about ports installing their scripts to /usr/local/etc/rc.d?

System initialization is explained in the SYSTEM INITIALIZATION section of this document: RUNIT-FASTER (7) - FreeBSD Miscellaneous Information Manual.

While the SERVICE TEMPLATES section of the same document explains how to start a service.

With this information, you should be able to create a script to start a service.
 
Besides FreeBSD, I also use Void. Runit is simple and that's fine, but it has the strange habit of automatically starting services. You don't appreciate this initiative when you want to replace the display manager, for instance. When you administer a machine, the less things getting in your way, the better.

That said, the interest of runit (or openrc and friends) is obvious in the systemd-parasited Linux world, but frankly, I can't see any advantage of using it on FreeBSD.

Moreover, if you change FreeBSD's init system, besides having more work and less help, you deprive yourself of a considerable amount of helpful (and mostly very good) existing documentation.

The only reason I could understand to change FreeBSD's init system is to use it as on occasion of learning about an aspect of how an OS works. ;)
 
Necro-bump - because this thread came up while I was searching for something else:

I have tried it and have used it for years out of rc.local. Recently I swapped the init via loader.conf to use runit-init instead of /sbin/init.

I did have to build it in ports because - the current (2025-01) release has an error that causes init replacement to fail in the case where /usr/local is mounted and not part of / base fs. (submitted to maintainer). While at it, I also moved all boot-transient files to /run instead of /etc.

I use it because I use Void, NetBSD and FreeBSD and like to maintain one service script for all.

To answer the question on rc's above, by default stage 1's script runs /etc/rc autoboot, stage 2's script runs "other" services in the service directory provided in the shell script and stage 3 stops stage 2 and cleans up. One can minimize the amount of time in 1 by setting the _enable flags appropriately to NO and moving services that can run in parallel to runit services. (E.g. I shut everything after FILESYSTEMS basically, including devd, and use it and tools like dhcpcd for networking in runit).

It provides the flexibility to balance between all the rc.d documentation etc and runit style parallel service running.
 
Back
Top