From e781085e364fd446421d60148689f4d2b271583e Mon Sep 17 00:00:00 2001 From: Celestia Ludenberg Date: Tue, 30 Jun 2026 19:48:14 +0200 Subject: [PATCH] docs: add Init Systems parent page with Dinit, Runit, S6 children --- docs/dinit.md | 90 ++++++++++++++++++++++++++++++ docs/index.md | 2 +- docs/init-systems.md | 62 +++++++++++++++++++++ docs/openrc.md | 11 +--- docs/runit.md | 113 ++++++++++++++++++++++++++++++++++++++ docs/s6.md | 128 +++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 397 insertions(+), 9 deletions(-) create mode 100644 docs/dinit.md create mode 100644 docs/init-systems.md create mode 100644 docs/runit.md create mode 100644 docs/s6.md diff --git a/docs/dinit.md b/docs/dinit.md new file mode 100644 index 0000000..e41dbab --- /dev/null +++ b/docs/dinit.md @@ -0,0 +1,90 @@ +--- +title: Dinit +layout: default +parent: Init Systems +nav_order: 2 +--- + +# Dinit + +**Dinit** is a modern init system designed for speed and correctness. Written in C++, it focuses on parallel service startup and dependency management without the bloat of systemd or the complexity of S6. + +## Philosophy + +Dinit aims to be a "better than OpenRC but simpler than S6" middle ground. It handles dependencies automatically (like systemd) but stays out of your way (like OpenRC). Services are defined in declarative config files, not shell scripts. + +## Who uses it? + +- Not widely adopted by major distros yet +- Popular in DIY Linux builds (Linux From Scratch, custom embedded) +- Available in Artix as an alternative init + +## Key concepts + +| Concept | What it means | +|---------|---------------| +| Service files | Declarative `.conf` files in `/etc/dinit.d/` | +| Dependencies | Automatic — Dinit figures out start order | +| Parallel startup | Very fast — starts services concurrently | +| Process supervision | Optional — can restart crashed services | + +## Basic commands + +```bash +# Start a service +dinitctl start sshd + +# Stop a service +dinitctl stop sshd + +# Enable at boot +dinitctl enable sshd + +# Disable at boot +dinitctl disable sshd + +# Check status +dinitctl status sshd + +# List all services +dinitctl list +``` + +## Example service file + +`/etc/dinit.d/sshd.conf`: +``` +type = process +command = /usr/bin/sshd -D +depends-on = dbus +depends-on = network +``` + +## Comparison with OpenRC + +| | OpenRC | Dinit | +|---|--------|-------| +| Service format | Shell scripts | Declarative config | +| Dependencies | Manual (`need`/`use`) | Automatic | +| Speed | Fast | Very fast (more parallel) | +| Complexity | Low | Medium | +| Supervision | No built-in | Optional | + +## Should you use it? + +Pick Dinit if: +- You want the fastest possible boot +- You like declarative config (YAML-like) +- You want automatic dependency resolution +- You don't mind a less mature ecosystem + +Stick with OpenRC if: +- You want maximum stability and community support +- You prefer shell scripts you can read and debug +- You don't care about shaving seconds off boot time + +## Learn more + +- [Dinit GitHub](https://github.com/davmac314/dinit) +- [Dinit documentation](https://davmac.org/projects/dinit/) +- [Artix Dinit page](https://wiki.artixlinux.org/Main/dinit) diff --git a/docs/index.md b/docs/index.md index b306a34..b4607b7 100644 --- a/docs/index.md +++ b/docs/index.md @@ -28,7 +28,7 @@ A community revival of Antergos — built on **Artix Linux** with **OpenRC**, ** ## Learn about Antergos NeXT -- [OpenRC](openrc) — what is OpenRC, why we use it, and how to use it +- [Init Systems](init-systems) — what init systems are, OpenRC, Dinit, S6, Runit - [Desktop Environments](desktop-environments) — available DEs in online mode - [Wallpapers](wallpapers) — where they go, how they work diff --git a/docs/init-systems.md b/docs/init-systems.md new file mode 100644 index 0000000..f8f5e62 --- /dev/null +++ b/docs/init-systems.md @@ -0,0 +1,62 @@ +--- +title: Init Systems +layout: default +nav_order: 3 +has_children: true +--- + +# Init Systems + +An **init system** is the first process that runs when your computer boots (PID 1). It's responsible for starting everything else — filesystems, networking, display manager, services, and more. Think of it as the foreman at a construction site: it doesn't do the work itself, but it makes sure everything gets started in the right order. + +Antergos NeXT lets you choose between **four** init systems during installation. This page explains each one so you can pick what suits you. + +> Don't know what init to choose? **Stick with OpenRC** — it's the default, it's well-tested, and it's what most Artix users run. + +## The inits + +| Init | Philosophy | Complexity | Speed | Used by | +|------|-----------|------------|-------|---------| +| [OpenRC](openrc) | Simple, modular, Unix-like | Low | Fast | Gentoo, Artix, Devuan, Alpine | +| [Dinit](dinit) | Modern, dependency-based | Medium | Very fast | New projects, minimal systems | +| [Runit](runit) | Minimal, reliable, Unix-like | Low | Very fast | Void Linux, AntiX | +| [S6](s6) | Supervision-based, secure | Medium-High | Very fast | New projects, embedded | + +## Choosing an init + +| If you want... | Pick... | +|----------------|---------| +| Something familiar and well-documented | OpenRC | +| The fastest boot possible | Dinit or S6 | +| The simplest, most Unix-like approach | Runit | +| Advanced supervision and process management | S6 | + +## What they all have in common + +- **No systemd** — all four are independent implementations +- **Service scripts** — services are configured via files in `/etc/` +- **Runlevels** — groups of services that start together +- **Logging to files** — logs go to `/var/log/`, not `journalctl` + +## What's different + +The main differences are in: + +1. **How services are defined** — OpenRC uses shell scripts, Dinit uses a declarative config format, Runit uses executable scripts, S6 uses a supervision tree +2. **How they manage dependencies** — some handle it automatically, some leave it to you +3. **How they supervise processes** — some restart crashed services automatically, some don't +4. **How fast they boot** — Dinit and S6 are designed for parallel startup and are noticeably faster + +## Learning Linux with init systems + +If you're new to Linux, learning about init systems is a great way to understand how your OS works under the hood. Here's why: + +- **You'll learn about processes** — PID 1, service trees, process supervision +- **You'll learn about boot order** — what needs to start before what +- **You'll learn about dependencies** — why NetworkManager needs dbus, why dbus needs udev +- **You'll learn about logging** — where logs go, how to read them +- **You'll learn about runlevels** — why your system behaves differently in single-user mode vs normal boot + +The best part? If you break something with services, you can always fix it — service management is much simpler than kernel config or package management. + +> **Pro tip**: If you're dual-booting or using a VM, try all four inits. Install a test system with OpenRC first, then reinstall with Dinit, then Runit, then S6. See which one feels right. diff --git a/docs/openrc.md b/docs/openrc.md index 9428dc3..058ff1b 100644 --- a/docs/openrc.md +++ b/docs/openrc.md @@ -1,18 +1,13 @@ --- title: OpenRC layout: default -nav_order: 3 +parent: Init Systems +nav_order: 1 --- # OpenRC -If you're here, you probably noticed Antergos NeXT doesn't use **systemd**. That's because we moved to **OpenRC** — a different init system. This page explains what that means for you. - -## What is an init system? - -When your computer boots, something has to start everything: mount filesystems, bring up networking, launch the display manager, start services. That "something" is the **init system** — it's the first process (PID 1) and the parent of everything else. - -**systemd** is the most common one (used by Arch, Fedora, Ubuntu, Debian). **OpenRC** is an alternative — lighter, simpler, and philosophically different. +**OpenRC** is the default init system in Antergos NeXT. It's used by Gentoo, Artix Linux, Devuan, Alpine Linux, and other non-systemd distros. It's proven, well-maintained, and about as simple as an init system can get while still being feature-rich. ## systemd vs OpenRC at a glance diff --git a/docs/runit.md b/docs/runit.md new file mode 100644 index 0000000..843e764 --- /dev/null +++ b/docs/runit.md @@ -0,0 +1,113 @@ +--- +title: Runit +layout: default +parent: Init Systems +nav_order: 3 +--- + +# Runit + +**Runit** is a UNIX init system with service supervision — a replacement for sysvinit and other init schemes. It's small, fast, and follows the Unix philosophy of doing one thing well. Written by Gerrit Pape, it's been around since the early 2000s and is battle-tested. + +## Philosophy + +Runit is built on the same ideas as daemontools (by DJ Bernstein): each service gets its own supervision directory with a `run` script, and a supervisor process (`runsv`) keeps it alive. If the service crashes, it's automatically restarted. No complex service files, no binary logs, no centralized daemon — just scripts and processes. + +## Who uses it? + +- **Void Linux** — its default init system +- **Artix Linux** — available as an alternative +- **AntiX** — defaults to runit +- Embedded systems, containers, minimal installs + +## How it works + +Runit boots in three stages: + +``` +Stage 1 (/etc/runit/1) → One-time initialization (filesystems, udev, etc.) +Stage 2 (/etc/runit/2) → runsvdir starts, supervises all services +Stage 3 (/etc/runit/3) → Shutdown (kill processes, unmount, halt) +``` + +Services live in `/etc/sv/` and are enabled by symlinking into `/run/runit/service` (or `/etc/runit/runsvdir/default/`). + +## Key concepts + +| Concept | What it means | +|---------|---------------| +| Service directories | Each service is a directory with an executable `run` script | +| `runsv` | Supervises one service, restarts it if it crashes | +| `runsvdir` | Starts/stops supervisors for a collection of services | +| `sv` | Main control tool — start, stop, restart, status | +| Runlevels | Directories under `/etc/runit/runsvdir/` (default, single, etc.) | +| Logging | Optional — add a `log/` subdirectory with its own `run` script | + +## Basic commands + +```bash +# Start a service +sv up sshd + +# Stop a service +sv down sshd + +# Restart a service +sv restart sshd + +# Check status +sv status sshd + +# Enable at boot (create symlink) +ln -s /etc/sv/sshd /etc/runit/runsvdir/default/ + +# Disable at boot (remove symlink) +rm /etc/runit/runsvdir/default/sshd +``` + +## Example service + +`/etc/sv/sshd/run`: +```bash +#!/bin/sh +exec /usr/bin/sshd -D +``` + +That's it. No config parsing, no dependency declarations, no unit files. If the script exits, runsv restarts it. If you want logging, add `log/run`: + +`/etc/sv/sshd/log/run`: +```bash +#!/bin/sh +exec svlogd -tt /var/log/sshd +``` + +## Comparison with OpenRC + +| | OpenRC | Runit | +|---|--------|-------| +| Service format | Shell scripts with `start()`/`stop()` | Executable `run` scripts | +| Dependencies | Manual (`need`/`use`) | None (automatic via sv) | +| Supervision | No built-in | Yes — auto-restart on crash | +| Logging | syslog or separate | Built-in per-service logging | +| Boot speed | Fast | Very fast | +| Complexity | Low | Low | + +## Should you use it? + +Pick Runit if: +- You want the simplest possible supervision system +- You like the daemontools model (one script per service) +- You want auto-restart on crash +- You're coming from Void Linux and want the same experience + +Stick with OpenRC if: +- You need dependency management +- You prefer shell scripts with start/stop/status functions +- You want something more mainstream + +## Learn more + +- [Runit official site](https://smarden.org/runit/) +- [Runit FAQ](https://smarden.org/runit/faq) +- [Artix Runit page](https://wiki.artixlinux.org/Main/Runit) +- [Runit on Gentoo Wiki](https://wiki.gentoo.org/wiki/Runit) diff --git a/docs/s6.md b/docs/s6.md new file mode 100644 index 0000000..a649a51 --- /dev/null +++ b/docs/s6.md @@ -0,0 +1,128 @@ +--- +title: S6 +layout: default +parent: Init Systems +nav_order: 4 +--- + +# S6 + +**S6** is a process supervision suite designed for modularity, security, and performance. It's not just an init system — it's a full ecosystem of tools for service management (`s6-rc`), logging, and system initialization (`s6-linux-init`). Written by Laurent Bercot, it's the most technically sophisticated of the non-systemd inits. + +> S6 is actually three layers: +> 1. **s6** — core process supervision (svscan, supervise, svc) +> 2. **s6-rc** — dependency-based service manager +> 3. **s6-linux-init** — creates the `/sbin/init` binary + +## Philosophy + +S6 takes the daemontools/runit model and extends it with: +- **Modularity** — every piece is separate and replaceable +- **Security** — services run with minimal privileges, no ambient authority +- **Performance** — fully parallel startup, designed for speed +- **Reliability** — automatic restart, logging, notification + +Unlike runit, s6 has a real dependency-based service manager (`s6-rc`) with declarative service definitions. It's the closest you can get to systemd's feature set without the bloat. + +## Who uses it? + +- **Artix Linux** — available as an alternative init +- **Chimera Linux** — uses s6 as its init system +- **Docker images** — s6-overlay is popular for container supervision +- Embedded systems, minimal Linux builds + +## How it works + +1. Kernel starts `/sbin/init` (created by `s6-linux-init-maker`) +2. `s6-linux-init` mounts tmpfs, copies early services, execs into `s6-svscan` +3. `s6-svscan` becomes PID 1 and starts the supervision tree +4. `rc.init` script launches `s6-rc` with the default runlevel +5. `s6-rc` resolves dependencies and starts services in order + +## Key concepts + +| Concept | What it means | +|---------|---------------| +| `s6-svscan` | PID 1 — root of the supervision tree | +| `s6-supervise` | Monitors one service directory, restarts on crash | +| `s6-svc` | Control tool — send commands to services | +| `s6-rc` | Dependency-based service manager (compiled database) | +| `s6-log` | Built-in logging with auto-rotation | +| Service directories | Like runit — each service is a directory with a `run` script | +| Compilation | `s6-rc` compiles service definitions into a binary database | + +## Basic commands + +```bash +# Start a service +s6-svc -u /run/service/sshd + +# Stop a service +s6-svc -d /run/service/sshd + +# Restart a service +s6-svc -r /run/service/sshd + +# Check status +s6-svc -a /run/service/sshd + +# With s6-rc (service manager): +s6-rc -d change sshd # start +s6-rc -d stop sshd # stop +s6-rc -d status sshd # status +``` + +## Example service + +`/etc/s6/sv/sshd/run`: +```bash +#!/bin/sh +exec /usr/bin/sshd -D +``` + +With s6-rc, you also need a service definition file: + +`/etc/s6/rc/sources/sshd/type`: +``` +oneshot +``` + +`/etc/s6/rc/sources/sshd/up`: +```bash +#!/bin/sh +s6-svc -u /run/service/sshd +``` + +## Comparison with OpenRC + +| | OpenRC | S6 | +|---|--------|-----| +| Service format | Shell scripts | `run` scripts + s6-rc definitions | +| Dependencies | Manual (`need`/`use`) | Automatic via s6-rc | +| Supervision | No built-in | Yes — full supervision tree | +| Logging | syslog or separate | Built-in per-service (`s6-log`) | +| Boot speed | Fast | Very fast | +| Complexity | Low | Medium-High | +| Flexibility | Moderate | Very high (modular) | + +## Should you use it? + +Pick S6 if: +- You want the most powerful non-systemd init +- You need dependency-based service management +- You like the idea of a compiled service database +- You value process supervision and auto-restart +- You're comfortable with a steeper learning curve + +Stick with OpenRC if: +- You want something simple and well-documented +- You need shell-script-based services you can debug easily +- You don't need process supervision or dependency resolution + +## Learn more + +- [S6 official site](https://skarnet.org/software/s6/) +- [S6 overview](https://skarnet.org/software/s6/overview.html) +- [s6-linux-init](https://skarnet.org/software/s6-linux-init/) +- [Artix S6 page](https://wiki.artixlinux.org/Main/S6) +- [S6 on Gentoo Wiki](https://wiki.gentoo.org/wiki/S6)