Quick Tip: Finding if a Linux server has a pending reboot

Linux servers generally don’t need to reboot that often. Normally they should only reboot after the kernel is patched or is upgraded. To determine if there is a pending reboot on a Linux server, just check if the following file exists.

/var/run/reboot-required

If it doesn’t exist, then the server does not need to be rebooted.

A nice easy Bash script can also check for this:

#!/bin/bash
if [ -f /var/run/reboot-required ]; then

  • echo ‘System needs to be rebooted’*
    fi

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s