Skip to content
glowfish

Home · Help · Setting up a Devuan server without systemd

Setting up a Devuan server without systemd

Devuan is Debian without systemd. Packages, apt and the directory layout are the same, services are started by sysvinit. This guide applies to Devuan 6 (Excalibur) on a Devuan server and shows what differs from Debian.

What is installed

  • sysvinit as the init system, the init scripts are in /etc/init.d.
  • ifupdown for the network. The address is in /etc/network/interfaces and is set during setup.
  • apt with the package sources deb.devuan.org/merged for Excalibur and the security updates.
  • sudo. OpenSSH for logging in is added when the server is set up.

The image is kept small. cron and a logging daemon are missing and can be installed with one command.

1. Updating and installing packages

apt update && apt full-upgrade
apt install nginx

Packages with their own service include an init script for sysvinit. The service runs after installation and starts with every reboot.

2. Managing services

PurposeDevuanDebian with systemd
Start, stop, restartservice nginx start|stop|restartsystemctl start|stop|restart nginx
Statusservice nginx statussystemctl status nginx
Enable at bootupdate-rc.d nginx enablesystemctl enable nginx
Disable at bootupdate-rc.d nginx disablesystemctl disable nginx
All servicesservice --status-allsystemctl list-units

3. Setting up your own service

Some programs only ship a systemd unit. A short init script with start-stop-daemon is enough. Save it as /etc/init.d/meindienst and adjust the program and user:

#!/bin/sh
### BEGIN INIT INFO
# Provides:          meindienst
# Required-Start:    $network $remote_fs
# Required-Stop:     $network $remote_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
### END INIT INFO

PROGRAMM=/usr/local/bin/meindienst
PIDDATEI=/run/meindienst.pid

case "$1" in
  start)   start-stop-daemon --start --background --make-pidfile --pidfile $PIDDATEI --chuid dienst --exec $PROGRAMM ;;
  stop)    start-stop-daemon --stop --pidfile $PIDDATEI --remove-pidfile ;;
  restart) "$0" stop && "$0" start ;;
  *)       echo "Aufruf: $0 {start|stop|restart}" && exit 1 ;;
esac
chmod 755 /etc/init.d/meindienst
update-rc.d meindienst defaults
service meindienst start

The INIT INFO block defines when the service starts. $network waits for the network.

4. Installing cron and logging

apt install cron rsyslog logrotate

After that, cron runs the entries from crontab -e, and the system logs are in /var/log/syslog. There is no journalctl without systemd.

5. Changing SSH settings

After a change in /etc/ssh/sshd_config, sshd -t checks the file and service ssh restart applies it. Keep one connection open until the new login works, so you do not lock yourself out. The console in the customer portal is available for emergencies.

Container and kernel

Devuan runs as a container with Incus. It uses the kernel of the host. Kernel updates and your own kernel modules are therefore not applicable. If you need your own kernel, choose a vServer with KVM, for example with Debian.

Frequently asked questions

Do Debian packages run on Devuan?
Yes. Devuan takes over the Debian packages and replaces only those that require systemd. Third-party .deb packages run as long as they do not require systemd features.
How do I switch from Devuan 5 to Devuan 6?
With a reinstallation in the customer portal. Data can be saved beforehand with the Rettungsverzeichnis, see Reinstalling a server without losing data.
Can I use OpenRC instead of sysvinit?
Devuan offers OpenRC as a package (apt install openrc). sysvinit is installed by default. Switching changes the boot process, so create a backup first.

See also: First steps on your vServer Setting up an Alpine Linux server

View Devuan servers