unit file
The text file, in a simple key=value format with sections such as [Unit], [Service] and [Install], that declares a systemd unit.
In more detail
Vendor unit files live in /usr/lib/systemd/system; your own and your overrides go in /etc/systemd/system, which wins. systemctl edit creates a drop-in override instead of changing the vendor file. After editing, run systemctl daemon-reload so systemd rereads the files.
Example
unit=worker exec=worker restart=fail user=worker records the command, restart policy and run-as identity.Related terms
- systemd unit — One object systemd manages, such as a service, a mount or a target, described by a unit file and named with a suffix like web.service.
- systemd service — A systemd unit that describes a long-running or one-shot process: what command to run, as which user and what to do when it exits.
- configuration file — A text file, usually under /etc, that tells a program or service how to behave.
Taught in
- systemd: Units, Targets And The Boot Graph — Linux Fundamentals & Systems Administration
- Your Own Unit, And Reading journald — Linux Fundamentals & Systems Administration