If you are running your own VPS server, you might receive emails from WHM a few times a week requiring you to log into WHM and gracefully reboot the server. The reasons vary … nevertheless, the chore is still annoying.
Here is a very simple workaround to this issue.
1. Log into WHM and install s-nail:
dnf install s-nail -y
2. Set up a cronjob that will reboot the server twice a week. To do this, open crontab:
crontab -e
3. …and add the following line to the list of cronjobs:
0 2 * * 2,5 /usr/bin/needs-restarting -r >/dev/null || (echo "Linux core updates require a reboot. The server is initiating a graceful reboot..." | /usr/bin/s-nail -s "NOTICE: WHM Server Rebooting" admin@yoursite.com && /usr/sbin/shutdown -r +5 "Linux Security Update: Graceful reboot scheduled in 5 minutes.")
This job will run every Tuesday and Friday at 2AM and will safely reboot the server.