mysql restarts every 10 minutes
I checked my audit logs today and saw a line like this reported every 10 minutes:
255. 11/11/2024 18:50:05 62 30313 restartsrv_mysq -1 108014
I then investigated my log file and found lines similar to this:
type=SYSCALL msg=audit(1731370201.915:108052): arch=c000003e syscall=62 success=yes exit=0 a0=4f03 a1=0 a2=45505 a3=7fffe193b6d0 items=0 ppid=32361 pid=32373 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="restartsrv_mysq" exe="/usr/local/cpanel/3rdparty/perl/514/bin/perl"
It suggests to me that perl that's shipped with cpanel is somehow restarting mysql every 10 minutes but I could be wrong.
Is there a way to make it where mysql doesn't restart every 10 minutes? it should run as a daemon.
-
Hey there! Could you confirm this inside the MySQL log file at /var/log/mysqld.log? It would be odd that we would be restarting MySQL every 10 minutes without a reason.
You could also check /var/log/chkservd.log to see if our automated monitoring tool is responsible for restarting the service.
0 -
ok so I was checking things today, and aureport tells me that restartsrv_mysql is being called now once every 2 to 2 1/2 hours. Not sure why mysql continues to restart.
I didn't do regular logging but I enabled the mysql error log and when I looked at it, there wasn't anything explainng anything wrong with mysql. I also checked dmesg and didn't find anything suggesting out of memory issues.
what of your scripts would be involved in checking and restarting mysql randomly?
0 -
Nothing every happens randomly :D
In the main MySQL log, which is located at /var/log/mysqld.log, do you see those restarts logged there? Here's what a restart block looks like on my personal system:
2024-05-08T09:35:43.878268Z 12439 [System] [MY-013172] [Server] Received SHUTDOWN from user root. Shutting down mysqld (Version: 8.0.37).
2024-05-08T09:35:46.500882Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.37) MySQL Community Server - GPL.
2024-05-08T09:35:46.888775Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.37) starting as process 508253
2024-05-08T09:35:46.901923Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-05-08T09:35:47.415831Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2024-05-08T09:35:47.713212Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2024-05-08T09:35:47.741965Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.37' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server - GPL.I stopped MySQL for a few minutes and let chksrvd restart the service, and this is what that restart looks like in the log:
2024-11-14T16:04:22.161663Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.40) starting as process 2210651
2024-11-14T16:04:22.169973Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-11-14T16:04:22.446493Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2024-11-14T16:04:22.616821Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2024-11-14T16:04:22.638019Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.40' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server - GPL.That also would have triggered an email notification to the server admin.
Does your log have similar entries?
0 -
I'm not sure what to put in my my.cnf file to enable logging because the normal logs were not being generated anymore but the error log was only to the time that mysql was first started. But now I ran checks and it seems mysql wants to stay running. I wonder if its because I removed old log files and old pids before restarting mysql.
For now, I'll declare the mysql case as solved.
0 -
I hope that's all this one is!
0 -
Something is going on with chkservd. My settings in WHM are to check services every 7200 seconds (2 hours). Every 2 1/2 hours MySQL restarts. (aureport shows restartsrv_mysql happening in that time), Its really strange.
0 -
At this point it would likely be best to create a ticket as I don't have a good explanation for what may be happening on this system.
0
Please sign in to leave a comment.
Comments
7 comments