Select Your Language

Infrastructure and Management

Cloud Computing

Storage

Runtimes

Integration and Automation

  • Comments
  • How to check if a host needs to reboot?

    Posted on

    Hello Community,

    I'd like to know how to figure out if a host needs to be rebooted after the installation of updates. Is there any way to determine wether a reboot is needed or not?

    By know I could use the following script to create a file if a reboot is necessary:

    #!/bin/bash
    LAST_KERNEL=$(rpm -q --last kernel | perl -pe 's/^kernel-(\S+).*/$1/' | head -1)CURRENT_KERNEL=$(uname -r)
    
    if [[ ! $LAST_KERNEL = $CURRENT_KERNEL ]];
    then
      touch /var/run/reboot-required
    fi
    

    But I'm not sure if a new kernelversion is the only reason that requires a reboot.

    On SLES there is the command

    zypper ps -s
    to check for running processes which use deleted files. Is there a similar mechanism in RHEL? Or are there no running processes which use deleted files because these are reloaded every time an update changes files used by some process?

    Kind regards,
    Joerg

    by

    points

    Responses

    Red Hat LinkedIn YouTube Facebook X, formerly Twitter

    Quick Links

    Help

    Site Info

    Related Sites

    © 2025 Red Hat