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

Taught in

References