June 27, 2026

Systemd Is More Than systemctl: A Practical Map of the Linux System Manager

Most developers meet systemd through one command: systemctl. Start a service. Stop it. Check its status. Restart it after a failure.

That is useful, but it is also a very narrow view of what systemd does.

On a modern Linux system, systemd is not only the process that starts services during boot. It is a system manager with a larger set of tools and contracts around service lifecycle, dependencies, logs, runtime directories, service accounts, resource limits, sandboxing, timers, sockets and activation.

For an embedded Linux product, that matters. A daemon is not production-ready just because the binary runs when someone executes it from a shell. It also needs a defined identity, a place to store runtime and persistent state, a restart policy, a logging path, dependency rules, resource boundaries and usually some security restrictions.

Note

This is the first article in a new systemd in Embedded Linux series. It is intentionally a map, not a reference for every unit option. Later articles will go deeper into units and dependencies, journald, tmpfiles.d, sysusers.d, service hardening, watchdogs, cgroups.

systemd is more than systemct

The first distinction: systemctl is not systemd


systemctl is a command-line client. It asks the system manager to inspect, start, stop, reload or restart units. On a system managed by systemd, those requests normally go through systemd’s D-Bus API.

This is the same idea we explored in the D-Bus series. systemctl is the convenient frontend. The running manager behind it owns the real unit state, queues jobs, resolves dependencies and supervises processes.

Tip

Use systemctl for human-friendly administration. When application code must control or inspect systemd, prefer the systemd D-Bus API instead of spawning a shell command and parsing its output.

This is an important mental shift. A command such as:

systemctl restart device-telemetry.service

does not directly send a signal to your process. It requests a state change for a unit. systemd may stop the old process, respect ordering rules, create a new start job, apply the unit’s execution settings and track the process tree in a cgroup.

That extra layer is not bureaucracy. It is where the product-level contract lives.

Related reading: D-Bus Introspection in Practice: Exploring systemd from the Command Line shows how to inspect the manager directly with busctl.

systemd has a core manager and a toolbox around it


When systemd runs as PID 1, it brings up and maintains userspace services. During boot it activates the configured default target and the units pulled in through that target’s dependency graph. Requests such as “start this unit” become jobs, and systemd coordinates those jobs according to dependency and ordering rules.

That is the core manager. But a practical systemd-based product also commonly uses related components:

  • systemd-journald collects and stores system logs.
  • systemd-tmpfiles creates, cleans and removes declared filesystem state.
  • systemd-sysusers creates declared system users and groups.
  • Unit execution settings define process identity, managed directories, lifecycle behaviour and sandbox restrictions.
  • cgroup-backed resource controls limit or account for CPU, memory, tasks and related resources.
  • Socket, timer, path and D-Bus units can activate work when an event happens instead of keeping every daemon running forever.

Not every distribution or embedded image enables every component. A small Yocto image may use a carefully selected subset, and that is normal. The useful part is understanding that these pieces belong to one operational model instead of treating each one as an unrelated Linux trick.

Common mistake

Do not assume a feature is available just because it exists in upstream systemd documentation. Check the systemd version, enabled packages, kernel support and image configuration on the actual target device.

a systemd service is more than a process

Why systemd is a newer generation of init system


systemd is often called a modern init system, but that does not simply mean that it replaced old startup commands with systemctl. It changed how a Linux system describes and coordinates startup work.

Classic System V init is built around runlevels and startup scripts. Services are commonly represented by shell scripts, and the intended startup order is often encoded through numbered links, such as S20network and S80application. This can work well on a small system, but dependencies, retries, directory setup and privilege decisions tend to become spread across scripts, package hooks and conventions.

Upstart improved this model by introducing event-driven jobs. A service could react to events such as a filesystem becoming available, a device appearing or networking changing state. It was an important move away from treating boot as only one fixed sequence of scripts.

systemd goes further by treating boot as a transaction over a graph of units. When it starts default.target, it pulls in the required units, resolves dependencies and ordering rules, queues jobs and can start independent work in parallel. A service that waits for a mount does not need to block an unrelated platform service from starting at the same time.

ModelHow startup is describedPractical consequence
System V initRunlevels and shell scriptsOrdering is often hidden in script names, links and shell logic.
UpstartJobs reacting to eventsServices can react to system changes instead of only a fixed runlevel sequence.
systemdUnits, dependencies, jobs and cgroupsRelationships are declarative, inspectable and independent work can run concurrently.

Parallel startup is visible, but it is not the whole benefit. systemd also gives one model for service supervision, restart handling, readiness, logs, runtime directories, service identities, resource controls, sandboxing and event-driven activation.

The real change

systemd does not make startup correct merely because more services start at the same time. Its value is that the required relationships and service contracts can be declared, reviewed and inspected on the running target.

fromstartupscripttounit

Units are the vocabulary of the system


Most people first learn one unit type: a .service file. But a unit is a more general concept. It is a declarative description of something systemd can manage, activate, order, supervise or group.

Common unit types include:

Unit typeWhat it representsTypical embedded use
.serviceA process systemd starts and supervisesDevice daemon, updater, telemetry agent, UI backend
.socketA socket that can activate a service on demandLocal IPC endpoint or network listener
.timerA time-based trigger for another unitPeriodic cleanup, health check, upload or maintenance task
.pathA watched path that activates work after a filesystem changeImport a file, react to generated configuration or a marker file
.targetA synchronization or grouping point in the boot graphBoot milestones and product-specific startup groups
.mountA managed mount pointData partition, removable storage or product filesystem
.sliceA hierarchical resource-management groupSeparate platform, application and background workloads

The important point is that units form a graph. A target can pull in services. A socket can start a service. A timer can trigger a service. A service can be ordered after a mount. A slice can contain multiple services and apply a shared resource boundary.

This is why “systemd boot order” is not usually one static script from line one to line five hundred. It is a graph of units, dependencies and jobs.

Ordering is not readiness

After=network.target says something about ordering. It does not prove that DHCP completed in the way your product expects, DNS is working, a remote service is reachable or your application dependencies are ready. Even network-online.target only reflects the definition of “online” provided by the network stack on that image; it is not proof that an external endpoint is usable.

Start processes in the right order when order matters, but still design applications to handle unavailable dependencies, changing connectivity and retries.

boot is a unit graph

A service unit is an operational contract


A small service file often begins like this:

[Service]
ExecStart=/usr/bin/device-telemetry

That starts a process, but it leaves many product decisions unspecified. Who owns the process? What happens when it exits with an error? Where should it create its socket? How much memory can it use? May it write anywhere in the root filesystem? Is the process actually ready when it has merely been spawned?

Even this short example already describes much more of a real service contract:

[Unit]
Description=Device telemetry daemon

[Service]
Type=notify
User=device-telemetry
ExecStart=/usr/bin/device-telemetry
Restart=on-failure
RestartSec=2s

RuntimeDirectory=device-telemetry
StateDirectory=device-telemetry

NoNewPrivileges=yes

[Install]
WantedBy=multi-user.target

This is not a universal production template. The correct dependencies, user, restart policy and hardening settings depend on the daemon. The point is that one unit can declare lifecycle, identity, runtime storage and part of its security policy next to the executable it runs.

  • Type=notify makes readiness explicit. The daemon must support the notification protocol and call sd_notify() with READY=1 only after it can perform its real work. Do not use it for a daemon that never sends that notification.
  • Restart=on-failure and RestartSec= describe what should happen after an unexpected exit. They slow a restart loop; they do not diagnose or fix the underlying fault.
  • User= avoids running the daemon as root by default.
  • RuntimeDirectory= makes per-service runtime state available under /run; it is normally removed when the service stops. StateDirectory= provides persistent service state under /var/lib.
  • NoNewPrivileges=yes is one small hardening control. It is not a complete security model.

Do not add network-online.target by habit

Some daemons genuinely cannot do useful work until the configured network manager reports connectivity. In that case, add After=network-online.target and Wants=network-online.target deliberately. Most network-aware daemons should instead start normally and handle unavailable or changing connectivity themselves.

Later in the series we will build a production-grade service unit and discuss the uncomfortable details: start timeouts, graceful shutdown, restart loops, watchdogs, readiness and failure diagnostics.

journald logs are part of the service contract


On many systems, developers still think about logs as files that appear somewhere under /var/log. That view is too small for systemd-managed services.

systemd-journald collects logs from several sources, including the kernel, the traditional syslog API and service output. It stores journal entries with metadata such as the boot, unit, process and priority. That lets you ask useful operational questions without first guessing which text file contains the answer.

For example, when a daemon fails after boot:

journalctl -u device-telemetry.service -b --no-pager

This asks for entries associated with one unit in the current boot. When persistent journal storage is enabled and previous boot logs are retained, this can also become:

journalctl -u device-telemetry.service -b -1 --no-pager

That is much more focused than opening a large generic log file and searching for a daemon name by hand.

Practical debugging flow

When a unit is not behaving correctly, start with systemctl status for the current unit state, then use journalctl -u <unit> -b to read the corresponding logs from this boot. Treat the two commands as one workflow.

For an embedded product, journal retention is a design decision. Volatile logs may be enough for development. A deployed device may need bounded persistent storage, log forwarding, a crash-collection strategy or a different logging backend. The point is not “always persist every log”. The point is to decide deliberately.

where systemd logs come togethe

tmpfiles.d and sysusers.d declare the state around a service


Linux products often accumulate hidden setup logic:

mkdir -p /run/device-telemetry
chown device-telemetry:device-telemetry /run/device-telemetry
chmod 0750 /run/device-telemetry

Maybe it lives in an init script. Maybe it is copied into an ExecStartPre= shell command. Maybe it is hidden inside the daemon itself. Later somebody adds a user with a post-installation script. Then another component creates a directory with different ownership. The system still boots, but the ownership model becomes difficult to review.

systemd provides declarative tools for this surrounding state.

Use service directory settings when the directory belongs to one service

For common per-service paths, unit settings are often the best starting point:

[Service]
User=device-telemetry
RuntimeDirectory=device-telemetry
StateDirectory=device-telemetry
CacheDirectory=device-telemetry
LogsDirectory=device-telemetry

This keeps ownership, location and lifetime close to the unit that uses the directories. In particular, a runtime directory under /run should normally disappear with the service lifecycle or the runtime system; it should not become a stale artifact from a previous boot.

Use tmpfiles.d for broader or independent filesystem rules

tmpfiles.d is useful when a path does not belong to one running service, when it needs cleanup rules, when several services share it or when you need a more complex declarative filesystem action.

# /usr/lib/tmpfiles.d/device-platform.conf
d /var/lib/device-platform/import 0750 device-telemetry device-telemetry -
d /run/device-platform/shared 0750 root device-platform -

These files can declare directories, files, links, permissions, ownership and time-based cleanup. They make the intended filesystem state visible in the image instead of relying on one-time shell setup.

Use sysusers.d to declare service identities

A non-root service account should not be an undocumented side effect of a package installation script. sysusers.d provides a declarative way to create system users and groups.

# /usr/lib/sysusers.d/device-telemetry.conf
u device-telemetry - "Device telemetry service account"

Now the service unit, its filesystem ownership and its Linux identity can be reviewed as a connected design rather than as three accidental implementation details.

Do not use tmpfiles.d just because it exists

If a directory is private to one service and should exist only while that service runs, first consider RuntimeDirectory=. Use tmpfiles.d where its broader lifecycle and filesystem capabilities are genuinely needed.

who owns this filesystem state

systemd gives each service a resource and security boundary


A systemd service is not just a PID to kill later. It is normally tracked in a cgroup. That matters because a unit is a process tree, not only the original main PID, and it gives systemd one place to apply accounting and resource policy.

Examples include:

[Service]
MemoryMax=256M
CPUQuota=40%
TasksMax=128

These settings should be introduced deliberately. A memory limit that is too strict can turn a recoverable load spike into a service failure. A CPU quota can affect latency. A task limit can break software that creates more threads or helper processes than expected. But the capability is important: one badly behaving daemon does not have to compete without limits against every other process on the device.

The same unit boundary can apply sandboxing controls:

[Service]
StateDirectory=device-telemetry

NoNewPrivileges=yes
PrivateTmp=yes
ProtectSystem=strict
ProtectHome=yes

With StateDirectory=, systemd makes the declared service state writable while the rest of the filesystem can remain protected by ProtectSystem=strict. Use ReadWritePaths= only when the service genuinely needs an additional writable location outside its declared state directories.

These are not a copy-and-paste checklist. A daemon may genuinely need access to a device node, a writable configuration file, a network socket family or a specific kernel interface. Good hardening starts with what the service really needs, expresses that as a small allow-list and then verifies the result through testing.

A useful exploratory command is:

systemd-analyze security device-telemetry.service

It can highlight common exposure in a service configuration. Treat the output as a review aid, not proof that a service is safe. It cannot understand your threat model, application logic or unsafe IPC API.

Activation means work does not always need to run forever


A common embedded design starts every daemon at boot and leaves it running permanently. Sometimes that is exactly correct. A long-running event loop may own hardware, keep protocol state or need predictable availability.

But some work is naturally event-driven:

  • A maintenance task should run every night.
  • A converter should run when a file arrives.
  • A local API service should start only when a client connects.
  • A D-Bus service can be activated when a client asks for its well-known name.

That is where timer, path, socket and D-Bus activation units fit. They describe the event that should cause a service to start.

This is not automatically better. Socket activation requires the service or its framework to handle passed file descriptors correctly. D-Bus activation needs a well-defined bus service contract. A timer may be less appropriate than a persistent worker when work must react immediately. But systemd gives you an explicit design option instead of forcing every feature into an always-running process.

A first exploration workflow on a real target


Before writing any unit files, inspect the target you actually have. Replace device-telemetry.service below with a service present on your system.

# How long did the current boot take?
systemd-analyze time

# Which dependency chain was critical for boot?
systemd-analyze critical-chain

# What is pulled in by the default boot target?
systemctl list-dependencies default.target

# What unit file and drop-ins are actually active?
systemctl cat device-telemetry.service

# What state does systemd currently report?
systemctl show device-telemetry.service \
  -p LoadState \
  -p ActiveState \
  -p SubState \
  -p MainPID

# What did this unit log during the current boot?
journalctl -u device-telemetry.service -b --no-pager

This is a better starting point than copying a service file from a blog post and hoping it matches the image, distribution, kernel configuration, network manager and product startup model you are actually using.

Embedded rule of thumb

Inspect the shipped image first. Then decide which systemd components your product needs. Do not start from the assumption that every desktop default belongs on a constrained device.

Common mental models that cause trouble


  • “systemd means systemctl.” systemctl is a useful client. The manager, unit graph and surrounding tools are the actual system.
  • “A service is just ExecStart.” A real service also has identity, lifecycle, state directories, logs, limits and often security requirements.
  • “After= means the dependency is usable.” Ordering is not readiness. The next article on dependencies will make this distinction concrete.
  • “Restart=on-failure solves reliability.” It may only create a delayed crash loop if you do not inspect failure state, logs and the underlying fault.
  • “Every service must run as root because it is a system daemon.” Many services can run with a dedicated account and a deliberately small set of writable paths or capabilities.
  • “Creating directories in shell scripts is normal startup work.” It is often better expressed by unit directory settings, tmpfiles.d and sysusers.d, where it can be reviewed and packaged declaratively.
  • “The same configuration will work everywhere.” systemd version, distribution policy, enabled packages, kernel support and embedded image design still matter.

The key idea


If you remember only one thing, remember this:

Key idea

systemd is a platform for declaring how system software should start, stop, log, store state, run with an identity, consume resources and react to events. systemctl is only one way to talk to that platform.

Once you see systemd this way, unit files stop being small pieces of boilerplate beside an executable. They become part of the executable’s operational API.

That is especially useful in embedded Linux. A device is easier to debug, secure and maintain when service lifecycle, filesystem state, logs and privileges are declared explicitly instead of spread across shell scripts, package hooks and tribal knowledge.