Skip to content

systemd

systemd is a suite of basic building blocks for a Linux system: it is the init system (PID 1), the service manager, and a collection of daemons providing logging (journald), device management (udevd), network configuration (networkd) and more.

Definition

What it is

systemd was written by Lennart Poettering and Kay Sievers at Red Hat in 2010, replacing SysV init and Upstart. It is the first process the kernel launches (PID 1). It reads unit files (*.service, *.socket, *.timer, *.target) that describe what to run, when, and how to restart.

Distributions using systemd: Debian, Ubuntu, Fedora, RHEL, CentOS, Arch Linux, openSUSE, and derivatives. Distributions not using it: Alpine (OpenRC), Void (runit), Gentoo (openrc).

Why it matters

Without systemd, service management was a mix of SysV scripts, Upstart configs and cron. With systemd, one command (systemctl enable --now foo.service) replaces ten. Logs are unified in journalctl. Timers replace cron for many jobs. Sockets are activated on demand.

systemd vs SysV vs OpenRC

Aspect

systemd

SysV init

OpenRC

Configuration

Declarative units

Shell scripts

Shell scripts

Parallelism

Yes

Serial

Yes

Logging

journald

syslog

syslog

Socket activation

Yes

No

Partial

Timers

Yes

cron

cron

Learning curve

Medium

Low

Low

The systemd lifecycle

graph TD
  K[Kernel] --> SD[systemd PID 1]
  SD --> T[target: multi-user]
  T --> S1[nginx.service]
  T --> S2[sshd.service]
  T --> S3[mysqld.service]
  S1 -.->|log| J[journald]
  S2 -.->|log| J
  SD --> Sock[socket units]
  SD --> Tim[timer units]
  style SD fill:#E8F5E9

How to use systemd well

systemd without pain

  1. Prefer `Type=simple`

    The process runs in foreground; systemd handles daemonizing. No double-fork code.

  2. Set `Restart=on-failure`

    Services auto-restart on crash. Not on clean exit.

  3. Use `ExecStart` with absolute paths

    Never rely on PATH in units.

  4. Logs via `journalctl -u name -f`

    Live tail without a separate log file.

  5. Timers instead of cron

    OnCalendar=*-*-* 03:00:00 is more precise and logs via journald.

Common failures

Origin

systemd was announced by Lennart Poettering in April 2010. Fedora was the first major distribution to adopt it (F15, 2011). Debian chose systemd over Upstart in 2014 and shipped it in Jessie (2015). Arch Linux adopted it in 2012. Today it is the default init on most Linux distributions.

systemd is a suite of basic building blocks for a Linux system. It provides a system and service manager that runs as PID 1 and starts the rest of the system.

— systemd documentation, 2024
2010 · systemd anunciado
2011 · Fedora 15 adopta
2012 · Arch Linux adopta
2015 · Debian Jessie adopta
2024 · systemd 256 estable

Evidence

FAQ

Is systemd the only init?

No. Alpine uses OpenRC, Void uses runit, Gentoo offers OpenRC. Most distros use systemd.

Why do people dislike systemd?

It does many things (logging, network, DNS). Some prefer small composable tools.

systemd vs cron?

systemd timers log to journald and can depend on services; cron is simpler and older.

Can I run systemd in Docker?

Yes, but requires --privileged or specific setup. Containers usually run one process without systemd.

Connections

Etymology

Origin: compound

  • system (noun): from Greek systema, "organized whole"
  • d (suffix): daemon (Unix convention)

Semantic network

systemdoperating-DaemonCronInitjournaldunit-file

● broader ● narrower ● related

Broader

  • operating-systems

Related

Used in the garden

Sources