How to check if a host needs to reboot?
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 -sKind regards,
Joerg
Responses