Getting the full systemd unit file for a service

You can run systemctl show servicename.service to get the “final” version of your systemd service file, including all overrides which would typically be loaded dynamically by systemd itself and not visible in the actual unit file. This is extremely helpful on NixOS where packages can sometimes re-use upstream systemd unit files and inject NixOS specific options through an override file.

June 30, 2025 · 1 min

Type='oneshot' services block systemctl CLI

Systemd runs all units that specify Type=oneshot to completion in a blocking manner which is what causes my NixOS configuration switching to sometimes get stuck with a long-running task. The solution is to use Type=simple and instead configure the restart policy to not fire unnecessarily.

June 30, 2025 · 1 min