Once I updated Ubuntu server and Zabbix-server by running apt update, apt upgrade, after the update was complete I agreed to restart all updated services, but Zabbix-server continued to be running for 20 minutes and did not restart.
After looking at the zabbix-server logs I found that it was trying to connect to mysql server, but mysql server was stopped by ubuntu’s process restart script, which was waiting for the zabbix-server process to stop, which could take forever.
A simple solution was to look at the PID of the zabbix-server process and terminate it manually:
pgrep zabbix_server
kill -9 pid process
But since the server was highly loaded, there were 700 zabbix-server processes running on it, so manually terminating each one was not an option. To solve the problem, I quickly saved the list of process IDs and added “kill -9” at the beginning of each line via Notepad++, then copied it to the clipboard and executed it in the SSH terminal:
kill -9 304
kill -9 305
kill -9 307
kill -9 308
kill -9 309
kill -9 310
kill -9 311
kill -9 321
kill -9 327
kill -9 328
kill -9 330
kill -9 331
kill -9 334
kill -9 336
kill -9 338
kill -9 339
kill -9 4193548
kill -9 4193549
...
After that, the ubuntu script successfully completed the following updated services and then started them including the mysql server and zabbix server.
See also my article:
How to add characters to the beginning of each line in Notepad++