CentOS RHEL – reboot after kernel update or if reboot needed

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
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
Scroll to Top