KRNL-5830: Check for /var/run/needs_restarting

Creating this file was introduced in slackpkg version 15.0.10.
This commit is contained in:
pyllyukko 2022-01-25 18:59:36 +02:00
parent ad5dc53a5f
commit 12ad1ca6bd

View File

@ -615,7 +615,8 @@
Register --test-no KRNL-5830 --os Linux --weight L --network NO --category security --description "Checking if system is running on the latest installed kernel" Register --test-no KRNL-5830 --os Linux --weight L --network NO --category security --description "Checking if system is running on the latest installed kernel"
if [ ${SKIPTEST} -eq 0 ]; then if [ ${SKIPTEST} -eq 0 ]; then
REBOOT_NEEDED=2 REBOOT_NEEDED=2
FILE="${ROOTDIR}var/run/reboot-required.pkgs" for FILE in "${ROOTDIR}var/run/reboot-required.pkgs" "${ROOTDIR}var/run/needs_restarting"
do
LogText "Test: Checking presence ${FILE}" LogText "Test: Checking presence ${FILE}"
if [ -f ${FILE} ]; then if [ -f ${FILE} ]; then
LogText "Result: file ${FILE} exists" LogText "Result: file ${FILE} exists"
@ -623,6 +624,7 @@
if [ "${FIND}" = "0" ]; then if [ "${FIND}" = "0" ]; then
LogText "Result: No reboot needed (file empty)" LogText "Result: No reboot needed (file empty)"
REBOOT_NEEDED=0 REBOOT_NEEDED=0
break
else else
PKGSCOUNT=$(${WCBINARY} -l < ${FILE}) PKGSCOUNT=$(${WCBINARY} -l < ${FILE})
LogText "Result: reboot is needed, related to ${PKGSCOUNT} packages" LogText "Result: reboot is needed, related to ${PKGSCOUNT} packages"
@ -630,10 +632,12 @@
LogText "Package: ${I}" LogText "Package: ${I}"
done done
REBOOT_NEEDED=1 REBOOT_NEEDED=1
break
fi fi
else else
LogText "Result: file ${FILE} not found" LogText "Result: file ${FILE} not found"
fi fi
done
# Check if /boot exists # Check if /boot exists
if [ -d "${ROOTDIR}boot" ]; then if [ -d "${ROOTDIR}boot" ]; then