Override a unit with a drop-in

Open /etc/systemd/system/myapp.service.d/override.conf in an editor for partial overrides

systemctl edit myapp.service

tool
systemd26 commands
tags
systemd

More systemd commands

  • systemctl cat myapp.service

    Print the full unit file, including drop-ins

  • systemd-analyze blame | head -20

    Show the 20 units that took the longest to start

  • systemd-analyze dot --require | dot -Tsvg > boot.svg && open boot.svg

    Render the boot dependency graph as SVG and open it

  • cat > /etc/systemd/system/myapp.service <<EOF [Unit] Description=My App After=network.target [Service] ExecStart=/usr/bin/myapp Restart=always RestartSec=5 User=appuser [Install] WantedBy=multi-user.target EOF

    Minimal service unit template with automatic restart

  • systemd-run --uid=1000 --gid=1000 --wait /usr/bin/myapp --task

    Run a transient unit as UID 1000 and wait until it finishes

all 26 systemd commands