Hello guys, I have an problem where some of my services stop working until I restart them. Services like ngix, mariadb, php7.4, so I have added the following codes to restart them automatically when not active so I won’t have to do them manually anymore.
if ! systemctl is-active --quiet mariadb; then
systemctl restart mariadb
fi
if ! systemctl is-active --quiet apache2; then
systemctl restart apache2
fi
if ! systemctl is-active --quiet bind9; then
systemctl restart bind9
fi
if ! systemctl is-active --quiet nginx; then
systemctl restart nginx
fi
if ! systemctl is-active --quiet php7.4-fpm; then
systemctl restart php7.4-fpm
fi
I added them to /usr/local/hestia/bin/v-update-sys-queue which is set to run every 2 minutes via cron job.
So I want to know if I can set it to run every minute, will it be ok?
Sure you can set your own time. I suggest you to copy one of those scripts from /usr/local/hestia/bin give it a new name add your code in there and last add your own cron job.
PS: if you create your own script from copying one of the other files, do not forget to make it executable!
Why in hestia bin folder if is not used for Hestia it self?
I had never an issue with with any service randomly stopping is that the case you probally need to check what happens en restarting it will only hide the issue