Every Linux machine you have ever used is quietly running dozens of background workers: the SSH server waiting for a login, the web server answering requests, the scheduler firing jobs on time. Those workers are called daemons, and on most modern distributions one program manages all of them: systemd, the system and service manager documented at freedesktop.org. systemd starts services at boot, keeps track of whether they are alive, collects their logs, and restarts them when a unit file tells it to. Learn a handful of systemctl verbs and one journalctl pattern, and you can start, stop, inspect, and debug almost any service on the box — including the one that is failing right now and not telling you why.

Arch Linux and systemd developers
Screenshot:
Paowee
, LGPL, via Wikimedia CommonsWhat a service — and a unit — actually is
In systemd’s vocabulary, everything it manages is a unit: a resource it knows how to start, stop, and monitor. Units are described by unit files, usually ending in a suffix that names their type. A .service unit describes a process to run — a daemon. A .socket unit describes a socket systemd listens on and activates a service for. A .timer unit describes a schedule, a .mount unit a filesystem mount, and a .target unit groups other units together so a whole stage of boot can be reached at once. When people say "the service," they almost always mean one .service unit: for example sshd.service, nginx.service, or your own application packaged the same way.
A service unit file states, among other things, the command to execute (ExecStart), the user to run as, what must start before it, and what should happen when the process exits. Unit files supplied by packages live under /usr/lib/systemd/system/, distribution and administrator overrides live under /etc/systemd/system/, and that layering is deliberate: your local file wins, so you can change how a packaged service runs without editing the package’s own file. After you edit any unit file, run systemctl daemon-reload so systemd re-reads its configuration before you try to start the changed unit — skipping that step is one of the most common reasons a fix "does nothing."
The five systemctl verbs you will use daily
systemctl is the command-line tool for controlling systemd, and five verbs cover most of daily work. systemctl start sshd starts a unit right now. systemctl stop sshd stops it. systemctl restart sshd stops and starts it again — the standard move after a configuration change — while systemctl reload sshd asks a service that supports it to re-read its configuration without dropping the process. None of these change what happens at boot.
Boot behavior is a separate verb: systemctl enable sshd creates the symlinks that make systemd start the unit at boot, and systemctl disable sshd removes them. Enabling is not starting — an enabled service begins at the next boot unless you also start it, and systemctl enable --now sshd does both in one command. systemctl is-enabled sshd reports the current setting when you are unsure.
The inspection verb is systemctl status sshd. It shows whether the unit is active, failed, or inactive, how long it has been in that state, the main process ID, recent log lines from that unit, and — for a failed unit — the exit information systemd recorded. Status is the first screen to read on any sick service, because it tells you which of two very different problems you have: the process never started at all, or it started and then died.
Hunting the daemon that’s failing
When something is wrong, start wide and then narrow. systemctl --failed (equivalently, systemctl list-units --failed) lists every unit currently in a failed state — the daemon hunt begins with that list, not with guessing. Pick the failed unit and read its status for the headline: exit code, the time it failed, and the last lines it printed.
Then go to the journal. systemd collects log output from services into the journal, and journalctl reads it. The workhorse command is journalctl -u sshd, which shows only that unit’s entries. Add -b to limit the view to the current boot, -f to follow new entries as they appear while you retry the service, --no-pager when you are piping the output somewhere, and -n 100 when you want just the last hundred lines. Read from the bottom up: the newest entries usually name the real cause — a missing file, a port already in use, a permission denial, a configuration error on a specific line — while the lines above it are the service announcing, step by step, that it was about to fail.
The fix loop is always the same shape. Read the error in the journal. Fix the thing it names — the config, the file, the permission. Run systemctl daemon-reload if you edited a unit file. Run systemctl restart on the unit. Then check systemctl status and the fresh journal entries to confirm the unit is active and staying up. A service that flips back to failed within seconds is telling you the first error was a symptom, so read the new journal entries rather than restarting in a loop.

Restart policies: making daemons heal themselves
A service unit can tell systemd what to do when its process exits, through the Restart setting in the unit file’s [Service] section. The documented values include no (the default — never restart), on-success, on-failure, on-abnormal, on-watchdog, on-abort, and always. In practice, Restart=on-failure is the workhorse for daemons: systemd restarts the service when the process exits with an error, is killed by a signal, or times out, but leaves it stopped when an administrator stops it deliberately or it exits cleanly. Restart=always goes further and restarts even after a clean exit, which suits services that are simply always supposed to be running. RestartSec sets how long systemd waits before each restart attempt, so a crashing service does not spin in a tight loop.
Two cautions keep restart policies honest. First, a restart policy hides nothing from the journal: every failed attempt is logged, so a daemon crash-looping under on-failure is visible in journalctl -u and in the restart counter shown by systemctl status. Second, automatic restarts are a safety net, not a repair — if a service needs its policy to fire every minute, the correct move is still the daemon hunt above: find the error, fix the cause, and let the policy go back to being insurance.
The bottom line
A daemon is just a background process, systemd is the manager that starts, stops, and watches it, and a unit file is its written job description. systemctl start, stop, restart, and enable control a service now and at boot; systemctl status tells you its state; systemctl --failed lists what is broken; and journalctl -u reads the failing unit’s own words about why it died. Add a Restart policy for the services that must heal themselves, and daemon hunting stops being folklore and becomes a four-command routine: list the failed, read the status, read the journal, fix the cause.
By Karl Amber
Sources
- systemd official documentation (freedesktop.org) — systemd: the system and service manager; what it manages and how units are started at boot.
- systemctl man page (freedesktop.org) — the start, stop, restart, reload, enable, disable, is-enabled, status and daemon-reload verbs, and listing failed units.
- systemd.unit and systemd.service man pages (freedesktop.org) — unit types and suffixes, unit file locations and precedence, ExecStart, and the Restart settings (no, on-success, on-failure, on-abnormal, on-watchdog, on-abort, always) with RestartSec.
- journalctl man page (freedesktop.org) — reading the journal by unit with -u, limiting to the current boot with -b, following with -f, and controlling pager and line-count output.
Editor’s note: this article is part of ScanderLoud’s Cybersecurity & Networking series. It was researched from primary documents — the systemd, systemctl, systemd.unit, systemd.service and journalctl documentation published at freedesktop.org — our coverage is original and educational throughout. No NetworkChuck video was opened or used.
Featured image: Software: Frank Denis Screenshot: VulcanSphere, ISC, via Wikimedia Commons

Leave a Reply