Fwd: New(re-made) Runit-for-LFS hint.

Gerard Beekmans gerard at linuxfromscratch.org
Tue Jul 22 13:11:23 PDT 2014

Hi James,

I have forwarded your  email to the hints mailinglist.

Gerard Beekmans

-------- Original Message --------
Subject: 	New(re-made) Runit-for-LFS hint.
Date: 	Mon, 21 Jul 2014 23:18:47 +0000
From: 	James Powell <james4591 at hotmail.com>
To: 	hints-owner at linuxfromscratch.org <hints-owner at linuxfromscratch.org>

Hey Bruce and everyone.

Over the last few months at LinuxQuestions.org, myself and several 
others have contributed into a project to bring another alternative init 
system to LFS which reworks the efforts of the previous Runit for LFS 
hint by Richard Downing into a modernized and updated effort.

We humbly stress that Runit is not a full replacement for sysvinit, but 
it can function well enough as a valid and viable alternative init and 
service management system as sysvinit is still the default LFS standard. 
As such, we have made as much of an effort as possible to keep sysvinit 
and lsb script compliancy and compatibility as our goal.

Contained in the tarball, are a readme, the also-included in the email 
hint and post-install setup script to automate a lot of finalizations 
and other setup work as well as the basics for a working system and 
build two small programs, as well as a collection of service 
installation scripts (complete with uninstall triggers for each) to 
correspond to many topics covered in BLFS. For those services we did not 
get scripts written for yet, we do have a service script to handle 
sysvinit and lsb scripts, and we hope to reduce the need for this 
backwards compatibility script as soon as possible, but do stress that 
even though we aim to reduce the need, we will keep it as a method of 
initializing services that need to be ported in with proper Runit 
service run files.

We have tested the hint build, scripts, and components of this bundle 
against both the SVN and 7.5 Stable releases, and both are found to be 
in working order.

Thanks for supporting and allowing alternative and additional software 
for LFS.

- The Runit-For-LFS team

James Powell
Keith Hedger
and several others who contributed but are unnamed at this time.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxfromscratch.org/pipermail/hints/attachments/20140722/3d057a63/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: runit-for-lfs-20140721.tar.bz2
Type: application/x-bzip2
Size: 12888 bytes
Desc: not available
URL: <http://lists.linuxfromscratch.org/pipermail/hints/attachments/20140722/3d057a63/attachment.bin>
-------------- next part --------------
Author(s):	James Powell <james4591 [at] hotmail [dot] com>
		Keith Hedger <email pending>
		Stoat <email pending>

Date: 2014-07-21 Version 1.0

License: The MIT License

Copyright (c) 2014 James Powell, Keith Hedger, and Stoat


Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.




Back in 2004 Richard Downing wrote his hint for Linux From Scratch aimed at
importing Runit as a suitable replacement for SysVInit which is showing it's
age and limitations as an init system. Now don't get me wrong sysvinit is very
flexible, sturdy, and reliable, but there's only so many configurations you can
do such as sysvinit which uses multiple symlinks between directories, or BSDinit
style, which uses, multiple directories off a single source. There's very little
else sysvinit provides, but it's good at what it does, and is very flexible and
cross-platform to various other UNIX variants.

Gerrit Pape wrote Runit several years ago to address this issue, but due to the
fact Runit was not a major sponsored init system, little effort was done to
import proper scripts into the workings of systems to give a full fledged Runit
script set to work from.

As an init system, Runit is fairly much like sysvinit, but it adds several
features including service daemon management, and parallel loading of daemons.
You can also use part of Runit to add service management into sysvinit as well,
if you desire. Runit is also sysvinit script compliant as well. Runit works by
loading daemons using shell scripts designed to load each service at the same
time, while linearly loading tracked dependencies. You can also use Runit to load
legacy sysvinit scripts just as you would in sysvinit and bsdinit if a run script
does not yet exist.

This hint borrows heavily from Richard Downing's work, based at his website:


as well as scripting from ArchLinux's Runit efforts located at:

and scripts from mat8913's github:

as well as work from VoidLinux:

but contains many modern fixes and updates to reflect the newer version of Runit
and proper FHS installations methods. By nature Runit is not LFS or FHS
conforming as it uses various directories outside the norm, but it can be made
to install with FHS and LFS standards.

Richard Downings hint may be viewed at:




None. Runit has no dependencies other than glibc, and the standard basic Linux

Installation time is about 0.2 or less SBUs and space requirements are probably
at least 2.5MB total, maybe even less.

This hint is aimed at LFS version 7.5 stable or later developmental systems.



I'd like to thank Bruce Dubbs and all the staff at LFS for allowing all the
extra hints we can all submit, use, and find a way to benefit from, as well as
rework older hints to be new and up-to-date.

I'd like to thank Richard Downing for his work with Runit, which in my opinion,
was incomplete, served as a spring board for this effort.

Many thanks to Keith Hedger and Stoat at LinuxQuestions for helping debug and
diagnose this hint, and sort out the scripting issues.

Many thanks to my late grandfather William H. Powell, Sr. who taught me to
always work for the benefit of others, and not just myself, and that when you
do whats right, you'll gain everything you desire in life, possibly even more
than you expected, even if you didn't want anything at all.



2014-05-01 - Initial drafting and Public Beta.

2014-05-05 - Happy Cinco De Mayo!!!
	     A huge break through. Several key service run files have been
	     imported successfully by Stoat and Keith Hedger at LinuxQuestions
	     which has opened up more services for usage with Runit. Testing
	     is still under way of other critical services, but really promising
	     results so far to find that successor to SysVinit that is worthy
	     of even being a successor to SysVinit.
2014-05-17 - Updates to the release effort. Changed scripts as needed for
	     startups and shutdowns.
2014-05-30 - Finalized official first public release.

2014-06-18 - Added new runlevel format.

2014-07-21 - Official bundled release.



First download a copy of Runit to your system:

Runit (2.1.1) - 109.7 KB
Homepage: http://smarden.org/runit/
Download: http://smarden.org/runit/runit-2.1.1.tar.gz
MD5 sum: 8fa53ea8f71d88da9503f62793336bc3

Next we're going to create a build directory for Runit and extract the package:

mkdir -pv runit-2.1.1
cd runit-2.1.1
tar -xvf ../runit-2.1.1.tar.gz
cd admin/runit-2.1.1
Now we'll build Runit as follows and install it using FHS methodology:

cd command
install runit runit-init /sbin
install runsvdir runsvchdir runsv /usr/sbin
install svlogd sv chpst utmpset /usr/sbin
cp ../man/* /usr/share/man/man8
ln -s /sbin/runit-init /sbin/init
mkdir -pv /etc/sv
mkdir -pv /etc/runit/runsvdir/single
mkdir -pv /etc/runit/runsvdir/multi
mkdir -pv /etc/runit/runsvdir/desktop
mkdir -pv /etc/runit/runsvdir/current

Post-installation, following the LFS-Bootscripts installation, please download
the setup-runit script from:


as well as the tarball containing all the service scripts from:


Make the script executable and run it, and if you require any daemons to
started at boot-time, check the tarball's services directory, and install the
appropriate run file scripts for Runit.

Do note that several low-level service handle scripts like dhcpcd, dhclient, and
such may still be used from the standard BLFS-Bootscripts without penalty. All
other scripts unless listed are supported for now through a backwards compatibility
layer through the sysv run file.

Description of application files:

runit - It performs the system's booting, running, and shutdown in three stages.

runit-init - The first process the kernel starts.

sv - Controls and manages services monitored by runsv.

runsvdir - Starts and monitors a collection of runsv processes.

runsvchdir - Changes services directory of runsvdir.

runsv - Starts and monitors a service and optionally an appendant log service.

svlogd - Runit's service logging daemon.

chpst - Runs a program with a changed process state.

utmpset - Logout a line from utmp and wtmp file.


>From here you'll have to run the provided "setup-runit" script provided in the
LFS-Hint's attachments directory, unless you downloaded it directly off Keith's
server, or obtained a copy from LinuxQuestions.org. This script will auto-build
all the base required bootscripts similar to how the LFS-Bootscripts package
operates. You will still need the LFS-Bootscripts installed at minimum before
you start this script. After you install this script, Runit will now use it's
own copied off init and run files to start daemons, and critical system
services. BLFS-Bootscripts may be required for some services and backwards



1. Why Runit and not just SysVinit?

Runit is really no replacement for SysVinit. It's a clean alternative meaning
that Runit does not require a vast rebuild of packages around itself just to
support the init system however. It uses the same exact Bash shell scripting
techniques so there's no new languages to learn. Plus, Runit is a UNIX init
system, not just a Linux init system. Runit is supported on *BSD as well as
partial support for Apple Darwin/OS-X and Oracle Solaris.

2. Can I use SysVinit scripts with Runit?

Yes, we have included a special sysv run file to execute any unsupported
scripts that require an eventual port to Runit run files. The run file
may be edited to add further support if necessary.

3. Are Runit run files easy to write?

It depends, but typically all a Run script is exactly, is the Start section of a
SysVinit script, while the Finish script is the Stop section.

4. Does Runit have any real benefits?

Yes. Runit provides service management of daemons to where services can be more
easily managed by the system so that in case of a failure the service can be
swiftly restarted, unless otherwise told to do so.

Runit also is drop in replacement ready for any GNU/Linux system. No packages
have to be rebuilt to use Runit, unlike systemd which requires MANY packages be
rebuilt against systemd to have it's support.

Runit is stable release software. Gerrit Pape so far has not developed Runit any
further than it has needed to be. It is confirmed to be extremely stable.

Parallel startup of services shaves time off the boot process by starting
multiple tree based services with dependencies together rather than one at a
time, however, you must write in the appropriate triggers for each service.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: setup-runit
Type: application/octet-stream
Size: 10883 bytes
Desc: not available
URL: <http://lists.linuxfromscratch.org/pipermail/hints/attachments/20140722/3d057a63/attachment.obj>

More information about the hints mailing list