How do you make a systemd service start on boot and restart on failure?
IntermediateConceptLinux and shell
Answer
Set Restart=on-failure (with RestartSec=5) in [Service] and WantedBy=multi-user.target in [Install], then run:
sudo systemctl daemon-reload && sudo systemctl enable --now myapp
More on Linux and shell
What does exit code 0 mean, and how do you see the last command's exit code?BeginnerHard link vs soft link?BeginnerWhat do the permissions `755` and `640` mean?BeginnerHow do you find which process is using the most CPU right now?BeginnerWhat is a zombie process?IntermediateSIGTERM vs SIGKILL?Beginner