Debian Bookworm with Mate and the shepherd init system

Shepherd? Never heard of that!

shepherd is the init system for guix. It has a lot of drawbacks for the average Debian user:

  1. It is not in an official Debian package, you have to install it yourself
  2. Following 1., package maintainers don't include in them the equivalent of an init script or systemd service, so writing these is on your own
  3. It is written in a Lisp like language called guile, which is not mainstream at all

So why bother using it? Several reasons:

  1. You may have noticed when reading other pages on this site that I don't like what systemd has become
  2. And keeping sysvinit is not attractive either
  3. No breaking features to be seen in other init systems worth testing them
  4. shepherd by contrary is an exotic beast a hacker can only be tempted to consider
  5. I was a guile contributor a long time ago, so the language is not a barrier at all

When Covid lockdown happened, I had a lot of free time, so I bite the bullet and went on implementing shepherd for Debian, to the point that shepherd runs now on my main hosts. Below is the result of that work.

Installing shepherd on Debian Bookworm

The following instructions are safe, they won't delete your existing init system, just renaming some binaries like /sbin/{halt,reboot,poweroff}, see below.

Installing guile-3.0

Bookworm packages guile-3.0.8. This will work, but I offer more recent version, guile-3.0.9. Below are the corresponding Debian packages:

amd64:

guile-3.0-libs 3.0.9-0bu1 amd64.deb guile-3.0-dev 3.0.9-0bu1 amd64.deb guile-3.0 3.0.9-0bu1 amd64.deb

guile-3.0 3.0.9-0bu1 amd64.build guile-3.0 3.0.9-0bu1 amd64.changes guile-3.0 3.0.9-0bu1 amd64.buildinfo

armhf:

guile-3.0-libs 3.0.9-0bu1 armhf.deb guile-3.0-dev 3.0.9-0bu1 armhf.deb guile-3.0 3.0.9-0bu1 armhf.deb

guile-3.0 3.0.9-0bu1 armhf.build guile-3.0 3.0.9-0bu1 armhf.changes guile-3.0 3.0.9-0bu1 armhf.buildinfo

Source:

guile-3.0 3.0.9-0bu1.dsc guile-3.0 3.0.9-0bu1.debian.tar.xz guile-3.0 3.0.9.orig.tar.gz

And you just have to run:

dpkg -i guile-3.0-libs_3.0.9-0bu1_amd64.deb guile-3.0-dev_3.0.9-0bu1_amd64.deb guile-3.0_3.0.9-0bu1_amd64.deb

Installing guile-fibers-1.3.1

This is a thread library for guile, not yet packaged for Debian. Here are the corresponding packages:

amd64:

guile-fibers 1.3.1-1bu amd64.deb

fibers 1.3.1-1bu amd64.build fibers 1.3.1-1bu amd64.changes fibers 1.3.1-1bu amd64.buildinfo

armhf (some costly tests have been suppressed in that 2bu version, as they exceeded RAM on the compiling host):

guile-fibers 1.3.1-2bu armhf.deb

fibers 1.3.1-2bu armhf.build fibers 1.3.1-2bu armhf.changes fibers 1.3.1-2bu armhf.buildinfo

Source:

fibers 1.3.1-1bu.dsc fibers 1.3.1-1bu.debian.tar.xz fibers 1.3.1-2bu.dsc fibers 1.3.1-2bu.debian.tar.xz fibers 1.3.1.orig.tar.gz

You install with:

dpkg -i guile-fibers_1.3.1-1bu_amd64.deb

Installing shepherd-0.10.2

This is the real init engine. Care has been taken with the Debian alternatives system to not clobber your original /sbin/halt, /sbin/reboot and /sbin/poweroff by renaming them as /sbin/halt.orig-init, /sbin/reboot.orig-init and /sbin/poweroff.orig-init.

The packages are below:

amd64:

shepherd 0.10.2-0.1 amd64.deb

shepherd 0.10.2-0.1 amd64.build shepherd 0.10.2-0.1 amd64.changes shepherd 0.10.2-0.1 amd64.buildinfo

armhf:

shepherd 0.10.2-0.1 armhf.deb

shepherd 0.10.2-0.1 armhf.build shepherd 0.10.2-0.1 armhf.changes shepherd 0.10.2-0.1 armhf.buildinfo

Source:

shepherd 0.10.2-0.1.dsc shepherd 0.10.2-0.1.debian.tar.xz shepherd 0.10.2.orig.tar.gz

And you install with:

dpkg -i shepherd_0.10.2-0.1_amd64.deb

Installing shepherd-debian-1.4

This package installs a set of the equivalent of init scripts or systemd services for shepherd. The list of packages whose daemons are currently handled is below:

  • rsyslog
  • util-linux
  • ntpsec
  • cron
  • anacron
  • openssh-server
  • fwknopd
  • unbound
  • nsd
  • ndppd
  • radvd
  • openvpn
  • cyrus-common
  • exim4-base
  • fetchmail
  • cups-daemon
  • apache2
  • postgresql-common
  • mariadb
  • bucardo
  • dbus
  • lightdm
  • uuid-runtime
  • zoneminder
  • bluetooth
  • dhcpcd
  • NetworkManager

This should be enough for a basic server or desktop. List of packages:

amd64:

shepherd-debian 1.4-2 amd64.deb

shepherd-debian 1.4-2 amd64.build shepherd-debian 1.4-2 amd64.changes shepherd-debian 1.4-2 amd64.buildinfo

armhf:

shepherd-debian 1.4-2 armhf.deb

shepherd-debian 1.4-2 armhf.build shepherd-debian 1.4-2 armhf.changes shepherd-debian 1.4-2 armhf.buildinfo

Source:

shepherd-debian 1.4-2.dsc shepherd-debian 1.4-2.debian.tar.xz shepherd-debian 1.4.orig.tar.gz

You install with:

dpkg -i shepherd-debian_1.4-2_amd64.deb

In case of errors, install the missing dependencies and retry.

Using shepherd

The above steps won't change your init system at next reboot. To use shepherd as the new init system, you have to add/change the init kernel boot argument as "init=/bin/shepherd". But I recommend you first study the README in package shepherd-debian for other useful information.

Using shepherd with Mate

If you use Mate, you may want to use these packages, see in package shepherd-debian the file README.elogind and the patches: login1.patch and udisk2.patch.

amd64:

elogind 246.10-1debian2bu amd64.deb libelogind0 246.10-1debian2bu amd64.deb libpam-elogind 246.10-1debian2bu amd64.deb

elogind 246.10-1debian2bu amd64.build elogind 246.10-1debian2bu amd64.changes elogind 246.10-1debian2bu amd64.buildinfo

Source:

elogind 246.10-1debian2bu.dsc elogind 246.10-1debian2bu.debian.tar.xz elogind 246.10.orig.tar.gz

All 3 packages have to be installed:

dpkg -i elogind_246.10-1debian2bu_amd64.deb libelogind0_246.10-1debian2bu_amd64.deb libpam-elogind_246.10-1debian2bu_amd64.deb