dinit a new init system
Dinit
Dinit is a service supervisor and init system designed to be simple, reliable, and dependency-aware. Unlike traditional init systems like SysVinit, Dinit manages services by tracking their dependencies and starting or stopping them in the correct order. It supports parallel service startup, automatic restart on failure, and clean shutdown sequencing. Originally developed as a lightweight alternative to systemd, Dinit is notable for being used as the default init system on Void Linux (as an option) and is well-suited for both desktop and embedded environments. It uses plain text service description files and has no mandatory dependencies on D-Bus or other system frameworks.
Step 1 - Install packages (Void Linux)
To install dinit run these 2 commands in your terminal:
xbps-install -Suy xbps && \
xbps-install -y \
net-tools \
sudo \
dinit \
rsyslog \
clang \
binutils \
coreutils \
dracut \
nano \
vim \
inetutils \
tzdataStep 2 - Create folder and copy basic init scripts
The dinit xbps package ships with some examples that you can find in:
/usr/share/doc/dinit/services/criete dir and copy content
mkdir /etc/dinit.d
cp -r /usr/share/doc/dinit/services/* /etc/dinit.d/Step 3 Make your Linux “Dinit-able”
Warning! You need to modify these init scripts:
dhcpcdfilesystem.sh
filesystem.sh: This script activates your swap but may fail — comment it out for now:
sed -i "s/ swapon /# swapon /g" /etc/dinit.d/filesystems.shdhcpcd: By default it uses the network interface enps3s0 — replace it with your actual network device or disable it:
follow this step to get your interface name
NETWORK=$(ip -brief addr show |grep UP| awk '{print $1}')sed -i "s/enps3s0/$NETWORK/g" /etc/dinit.d/dhcpcd.sh
# remove dependecies from netdev-enps3s0
sed 's/depends-on: netdev-enps3s0/#depends-on: netdev-enps3s0/g' dhcpcd Step 4 - Switch to dinit
Modify the init, reboot, poweroff and shutdown symbolic links:
sudo unlink /usr/sbin/init
sudo unlink /usr/sbin/reboot
sudo unlink /usr/sbin/poweroff
sudo unlink /usr/sbin/shutdown
sudo ln -s /usr/sbin/dinit /usr/sbin/init
sudo ln -s /usr/sbin/dinit-poweroff /usr/sbin/poweroff
sudo ln -s /usr/sbin/dinit-reboot /usr/sbin/reboot
sudo ln -s /usr/sbin/dinit-shutdown /usr/sbin/shutdown