systemd services
Run your application as a proper Linux service with systemd: what systemd does, writing a unit file for a Java, Node.js or Python app, environment files for secrets, restart policies, users and security hardening, logs with journalctl, timers instead of cron, and troubleshooting a service that will not start.
CodexBash, , 5 min read
Starting an application with java -jar app.jar & over SSH works until you log out, the server reboots, or the process crashes at night and nobody notices. On almost every modern Linux distribution, the right way to keep a program running is to make it a systemd service. systemd starts it at boot, restarts it when it crashes, runs it as an unprivileged user, collects its logs, and gives you one consistent set of commands to manage it. This guide writes a service from scratch and covers the settings that matter in production.
Sign in to read the rest
The whole 5 minute article is free with an account, along with every problem, lesson and tutorial. No card.