CentOS

CentOS RHEL – reboot after kernel update or if reboot needed

JJ
Jobin Joseph · Founder and CEO
·Published 5 December 2017·1 min read

Yum-Cron

Yum-cron is used to update the server automatically. This service will update the server with all the packages or only the security patches as configured on /etc/yum/yum-cron.conf

But, the yum-cron lack in reboot feature. If any packages, say kernel, glibc or gcc require a reboot of the server then we have to do the reboot manually.

Solution

We can solve this issue by adding a simple cron to the server. This cron will check if any package requires reboot of the server, below is the cron command and the cron.

0 5 * * * /usr/bin/needs-restarting -r || shutdown -r
Jobin Joseph
Jobin Joseph, Founder and CEO
5x AWS Certified, ISO 27001:2022 Lead Implementer, 17+ years building cloud infrastructure for regulated industries.
About Jobin →

Reading this because your AWS bill or uptime is a problem?

30 minutes, direct with the founder, no sales pitch: one specific recommendation for your AWS workload.

Book a free 30-minute review
30 min Free Consultation →