systemctl

show enabled but not running services

failed is probably the state I’m really curious about.

systemctl list-units -all --state=inactive
systemctl list-units -all --state=failed

check if a service is running

systemctl is-active SERVICENAME
## or quietly
systemctl is-active --quiet SERVICENAME

systemctl enable SOMETHING.something: “Failed to execute operation: No such file or directory”

After copying the target/service files into /etc/systemd/system/ systemctl has to learn about them?

systemctl daemon-reload

bus error blah blah

When you su to a user, make sure XDG_RUNTIME_DIR is set to /run/user/$(id -u)

export XDG_RUNTIME_DIR=/run/user/$(id -u)