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.
In more detail
Its [Service] section holds ExecStart for the command, User for the identity and Restart for the failure policy. systemctl start runs it now and systemctl enable makes it start at boot. Keep the declaration small and put application settings in the application's own configuration or an environment file.
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.
- unit file — The text file, in a simple key=value format with sections such as [Unit], [Service] and [Install], that declares a systemd unit.
- Restart= — The systemd service setting that decides when systemd restarts a process that exits, such as on-failure or always.
- environment file — A file of name=value lines that a systemd service loads into its process environment with EnvironmentFile=.
Taught in
- systemd: Units, Targets And The Boot Graph — Linux Fundamentals & Systems Administration
- Your Own Unit, And Reading journald — Linux Fundamentals & Systems Administration