Ubuntu 20.04 VPS randomly restarting with Cron Job
I'm having problems with my VPS. It's randomly restarting, and according to the syslog, it's due to a cron job. I don't have any cron jobs running to reboot the server. It rebooted a bit over a week ago, due to again, a cron job. I have no clue why this is happening, and it's really annoying. I've used crontab -l and there's nothing but the regular webmin stuff. I've read that this could be a PSU issue, but however I just rent the server, I do not own it, so there is nothing I can really do with that. Any ideas of what could be happening? Everything is as up to date as it can, kernel version I think is 5.4.0. It's Ubuntu 20.04, the VPS is provided by Hostinger, and it's a 2 core 2gb ram VPS. I'm running a site and about 2-3 Node.JS apps on the VPS.
EDIT: On further inspection, I noticed something. The syslog says this
Feb 14 13:45:57 freshclam[455]: Sun Feb 14 13:45:56 2021 -> !Database load killed by signal 9
Feb 14 13:45:57 freshclam[455]: Sun Feb 14 13:45:56 2021 -> !Database test FAILED.
Feb 14 13:45:57 freshclam[455]: Sun Feb 14 13:45:56 2021 -> !Unexpected error when attempting to update database: daily
Feb 14 13:45:57 freshclam[455]: Sun Feb 14 13:45:56 2021 -> ^fc_update_databases: fc_update_database failed: Test failed (8)
Feb 14 13:45:57 freshclam[455]: Sun Feb 14 13:45:56 2021 -> !Database update process failed: Test failed (8)
Feb 14 13:45:57 freshclam[455]: Sun Feb 14 13:45:56 2021 -> !Update failed.and then it starts ending a crap ton of sessions. Only thing that looks out of place was a bunch of error about Trust Issues, but those were appearing way before it restarted.
But, what makes me believe it's a cron job is
A. Hostinger has a "Recent Actions" tab, and it says "ct_reboot" was run, which these things only appear if it's a cron job.
B. In the syslog, it says
Feb 14 13:49:48 cron[167]: (CRON) INFO (Running @reboot jobs)I'm not sure if this means if a cron job was run to reboot, but this is what info I have.
I checked in /etc/crontab. Nothing out of the ordinary in /etc/crontab. sudo journalctl -b -1 -e just spits out a bunch of Stopped Session "insert more stuff here". Also Fail2Ban is set up and working.
1 Answer
I just checked on freshclam. Its purpose is to update the virus databases with the latest definitions.
It can be set up as daemon process to update the virus definitions
You can do a ps -ef | grep to see if it's running.
It's also a good idea to find the freshclam.conf file and inspect the settings. Based upon the error codes, it wants to do the updates daily, but there could be a reason why the database update fails in this particular way.
Could it be a good idea to remove the database and or reinstall the daemon for freshclam?
Along the lines of messages on the cron running reboot jobs, I also found this:
which suggests that the message doesn't necessarily indicate a failure. Go figure !
1