brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: systemd-analyze verify finds typos in a unit file before you start it

Systemd
~/tips/tip-systemd-analyze-verify-unit

systemd-analyze verify /etc/systemd/system/myapp.service

Checks a unit file for unknown directives and missing binaries without starting anything.

A misspelled directive in a unit file is only a warning in the journal, which is easy to miss.

systemd-analyze verify /etc/systemd/system/myapp.service

verify loads the unit and prints warnings for unknown sections or directives and for missing dependencies. No output means nothing was found. It also loads the units that the file refers to, for example through Requires= and After=, so errors in related files can show up too. Note that it checks the unit definition, not whether the service actually works at runtime. It is a good habit to run it in a deployment script.

Further reading: systemd-analyze manual page

More Systemd tips [Service] sudo mkdir -p /etc/systemd/system/service.d [Service] printf 'hunter2' | sudo systemd-creds encrypt --name=dbpass – dbpass.cred systemd-analyze timespan 1h30min All Systemd tips (88) All topics

Link