Home

UnitDateien

UnitDateien are configuration files used by systemd, the init and service manager for Linux. They describe units, which are resources or services that systemd manages, and determine how and when these units start, stop, and interact with each other.

A unit file is a plain text file with an INI-like structure. It is divided into sections

Unit types describe the kind of resource. Typical types include service (daemons), socket (socket-activated services), timer

Locations and overrides: unit files reside in system-wide locations such as /lib/systemd/system, /usr/lib/systemd/system, or /etc/systemd/system. Administrators

Management: after creating or editing unit files, systemd must be reloaded with systemctl daemon-reload. Units can

such
as
[Unit],
[Service],
and
[Install],
each
containing
key=value
pairs.
Common
directives
include
Description
and
Documentation
in
[Unit],
ExecStart,
ExecStop,
User,
Group,
Restart,
Environment,
and
WorkingDirectory
in
[Service],
and
WantedBy
and
Also
in
[Install].
These
settings
define
metadata,
dependencies,
startup
behavior,
and
installation
targets.
(time-based
triggers),
path,
mount,
automount,
swap,
target
(unit
groups),
slice
(resource
management),
device,
and
scope.
Templates
use
the
@
notation
to
create
multiple
instances
of
a
unit,
such
as
[email protected].
commonly
place
custom
units
or
overrides
in
/etc/systemd/system.
Drop-in
snippets
in
/etc/systemd/system/FOO.service.d/*.conf
can
override
or
extend
settings
without
modifying
the
main
unit
file.
be
enabled
to
start
at
boot,
started
or
stopped
manually,
and
queried
for
status.
Enabling
creates
startup
symlinks
under
targets
like
multi-user.target.wants.
Templates
and
dependencies
allow
flexible
and
scalable
service
orchestration.