Posts

Showing posts from October, 2017

Alert: *** System restart required *** [ubuntu]

We must reboot our server when we install a new kernel or libraries, Ubuntu Linux can tell you if the system needs a reboot when you login as root user. *** System restart required *** The above warning will appear on the login screen, we may miss this warning. So here is the simple script for administrators to find exactly when the system requires reboot. You can manually find the file: /var/run/reboot-required, which indicates System restart required. Instead of a manual search, you can use below script to identify the ubuntu notification of 'system restart required’ at every login and never miss the warning. Add the below lines in the file: /root/status.sh #!/bin/bash if [ -f /var/run/reboot-required ] then    echo -e "\033[33;31m[*** Hello $USER, you must reboot your machine ***]\033[0m" else    echo -e "\033[33;32m\n*** System reboot is NOT required now ***\n`cat /var/lib/update-notifier/updates-available`\n\033[0m" fi Now we