Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions client/patchman-client
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,22 @@ reboot_required() {
return
fi

# RHEL/Fedora: dnf needs-restarting checks the kernel and core libraries.
# It also exits 1 on errors (e.g. plugin not installed), so only trust
# that exit code together with its reboot message.
if check_command_exists dnf ; then
local needs_restarting
needs_restarting=$(LC_ALL=C dnf needs-restarting -r 2>/dev/null)
local rc=$?
if [ ${rc} -eq 0 ] ; then
reboot=False
return
elif [ ${rc} -eq 1 ] && echo "${needs_restarting}" | grep -q 'Reboot is required' ; then
reboot=True
return
fi
fi

# Compare running vs installed kernel via /boot/vmlinuz symlink
if [ -e /proc/sys/kernel/osrelease ] && [ -L /boot/vmlinuz ] ; then
running_kernel=$(cat /proc/sys/kernel/osrelease)
Expand Down
Loading