ObjectiveReplace systemd with SysV Init as the init system on Debian Stretch
RequirementsA working Debian Stretch install with root privileges.
- # - requires given linux commands to be executed with root privileges either directly as a root user or by use of
- $ - requires given linux commands to be executed as a regular non-privileged user
IntroductionNot everyone loves systemd, and for those that don't, there really aren't many options. That's especially true if you want something like a stable server. Fear not, SysV Init is actually still supported under Debian, and it's not hard to switch.
**Note:** don't try this if you're running GNOME or another desktop environment that has a hard dependency on systemd. It will just break your system.
Add Devuan RepositoriesThis part isn't strictly necessary if you just want to switch the init system and leave systemd installed as a compatibility layer. That would work fine. If you absolutely don't want systemd on your system at all, you need to make some arrangements to make the things that depend on it work.
Devuan, the systemd-less Debian fork is lagging a bit behind. Their Stretch release, ASCII, isn't ready, and running Devuan's testing releases isn't super stable right now. However, the did build some crucial packages to make systemd-dependent programs work without it, and you can use them in Debian.
First, create a new
/etc/apt/sources.list.d/for Devuan. Then, add the following line to it.
deb http://packages.devuan.org/devuan/ ascii mainSave that and exit.
Next, you're going to need the Devuan signing key. Grab that with
Pin The Devuan PackagesUnless you want a really weird Debian/Devuan hybrid, you're going to need to pin only the Devuan packages that you need. Create a file,
/etc/apt/preferences.d/. Add the following lines to it.
It's lengthy and annoying, but it'll keep a lot of things from breaking once you remove systemd. Update before moving on.
Package: * Pin: release a=stable Pin-Priority: 1000 Package: * Pin: release a=ascii Pin-Priority: 2 Package: udisks2 Pin: release a=ascii Pin-Priority: 1001 Package: libudisks2-0 Pin: release a=ascii Pin-Priority: 1001 Package: cgmanager Pin: release a=ascii Pin-Priority: 1001 Package: libcgmanager0 Pin: release a=ascii Pin-Priority: 1001 Package: libpolkit-agent-1-0 Pin: release a=ascii Pin-Priority: 1001 Package: libpolkit-backend-1-0 Pin: release a=ascii Pin-Priority: 1001 Package: libpolkit-gobject-1-0 Pin: release a=ascii Pin-Priority: 1001 Package: policykit-1 Pin: release a=ascii Pin-Priority: 1001
# apt update
Install The Devuan PackagesThe next step is fairly straightforward. Install all of the packages you just set up for.
# apt -t ascii install udisks2 libudisks2-0 cgmanager libcgmanager0 libpolkit-agent-1-0 libpolkit-backend-1-0 libpolkit-gobject-1-0 policykit-1
Install SysVYou're finally ready to install SysV. This one is also pretty easy.
# apt install sysvinit-core sysvinit-utilsThen, copy SysV's inittab to make it the system default.
# cp /usr/share/sysvinit/inittab /etc/inittabOnce everything is in place, and you're confident that you installed everything properly, restart the system. You should see the difference immediately in the boot process.
Remove SystemdAgain, this step is totally optional and may still break things. This will pull out systemd and anything that still depends on it. You have been warned.
# apt remove --purge --auto-remove systemdIf you want to make the change stick, add systemd to your Apt preferences.
Package: systemd Pin: release * Pin-Priority: -1