'How to automatically restart Jar program when its down in AWS EC2?
I'm running a java program in EC2 instance. Is there a way to automate so that when process is down it will run restart automatically?
Right now, I get an alarm with Spring boot actuator when the process is down. And would like to automate restart command.
amazon-web-services">
amazon-web-servicesamazon-cloudformation">
amazon-cloudformationspring-boot-actuator
Solution 1:[1]
Yes, one option (if you run a Linux distro with systemd on the EC2 instance)is to create something called a "systemd service" and define that you java application should run in the background and be restarted when the application is down.
See this post for an example
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Hans-Christian |
