There is an issue, not often but it can happen, MariaDB service stops and until manually starting in panel all sites not working
How this service start via bash?
I think write script which were check perfomance and if MariaDB fault down start it
Same issue i noticed in ¿Why Clamav-Daemon stop?
with other module
Check if there is enough memory available
Server work at more then on year, it seems that it is not standard issue
On vps server:
RAM : 4096 MB
SWAP : 256 MB
Could you clear, how mariadb start via command same as clamav for example - clamav-daemon restart
systemctl restart mysql
or systemctl restart mariadb
Well, this script can be using by cron and solve an problem above
#!/bin/bash log_file="/var/log/mariadb_status.log" # Checking the status of the MariaDB service status=$(systemctl is-active mariadb) if [ "$status" = "inactive" ]; then echo "$(date): The MariaDB service is stopped. Starting the service..." >> "$log_file" # Starting the MariaDB service systemctl start mariadb # Checking the status after starting new_status=$(systemctl is-active mariadb) if [ "$new_status" = "active" ]; then echo "$(date): The MariaDB service started successfully." >> "$log_file" else echo "$(date): Failed to start the MariaDB service." >> "$log_file" fi else echo "$(date): The MariaDB service is already running." >> "$log_file" fi
Converted it to code tags for read ability
You better use “monit” instead.
this or any monitoring software. also mysql should not stop out of the blue, better to find and solve the “base issue”.