12
I created a startup script for my application in Centos, so I can use the commands below to initialize/stop the application:
service django_app start
service django_app stop
How do I ensure this service is always running?
For example, if there is an error in the application and the service is terminated, there is some way to restart the service automatically in Centos?
One solution is to create a cronjob that runs every X minutes, and runs a script that checks and resets if needed.
– J. Bruni
A command of the type
ps aux | grep "django_app"
can help verify if the application is among the running processes.– J. Bruni