You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior
It's unclear if I should just disable this test, or if it should still function correctly at 'runlevel 5'
Additional context
I'm not sure when I started seeing this message, I'm running Lynis on Ubuntu 18.04 I run the audit system from a cronjob and then grep the lynis-report.dat for suggestion entries.
Performing test ID BOOT-5180 (Check for Linux boot services (Debian style))
suggestion[]=BOOT-5180|Determine runlevel and services at startup|-|-|
The code is different now, but the result is similar. The runlevel returns 'N 5' which results in the "Determine runlevel and services at startup" message.
--- tests_boot_services.orig 2021-04-05 13:07:46.697907005 -0600
+++ tests_boot_services 2021-04-05 13:26:55.320215347 -0600
@@ -724,7 +724,7 @@
# Runlevel check
sRUNLEVEL=$(${RUNLEVELBINARY} | ${GREPBINARY} "N [0-9]" | ${AWKBINARY} '{ print $2} ')
LogText "Result: found runlevel ${sRUNLEVEL}"
- if [ "${sRUNLEVEL}" = "2" ]; then
+ if [ "${sRUNLEVEL}" = "2" ] || [ "${sRUNLEVEL}" = "5" ]; then
LogText "Result: performing find in /etc/rc2.d as runlevel 2 is found"
FIND=$(${FINDBINARY} ${ROOTDIR}etc/rc2.d -type l -print | ${CUTBINARY} -d '/' -f4 | ${SEDBINARY} "s/S[0-9][0-9]//g" | sort)
if [ -n "${FIND}" ]; then
or:
--- tests_boot_services.orig 2021-04-05 13:07:46.697907005 -0600
+++ tests_boot_services 2021-04-05 13:07:25.322033166 -0600
@@ -724,16 +724,16 @@
# Runlevel check
sRUNLEVEL=$(${RUNLEVELBINARY} | ${GREPBINARY} "N [0-9]" | ${AWKBINARY} '{ print $2} ')
LogText "Result: found runlevel ${sRUNLEVEL}"
- if [ "${sRUNLEVEL}" = "2" ]; then
- LogText "Result: performing find in /etc/rc2.d as runlevel 2 is found"
- FIND=$(${FINDBINARY} ${ROOTDIR}etc/rc2.d -type l -print | ${CUTBINARY} -d '/' -f4 | ${SEDBINARY} "s/S[0-9][0-9]//g" | sort)
+ if [ "${sRUNLEVEL}" = "2" ] || [ "${sRUNLEVEL}" = "5" ]; then
+ LogText "Result: performing find in /etc/rc${sRUNLEVEL}.d as runlevel ${sRUNLEVEL} is found"
+ FIND=$(${FINDBINARY} ${ROOTDIR}etc/rc${sRUNLEVEL}.d -type l -print | ${CUTBINARY} -d '/' -f4 | ${SEDBINARY} "s/S[0-9][0-9]//g" | sort)
if [ -n "${FIND}" ]; then
COUNT=0
for SERVICE in ${FIND}; do
- LogText "Found service (at boot, runlevel 2): ${SERVICE}"
+ LogText "Found service (at boot, runlevel ${sRUNLEVEL}): ${SERVICE}"
COUNT=$((COUNT + 1))
done
- Display --indent 2 --text "- Check services at startup (rc2.d)" --result "${STATUS_DONE}" --color WHITE
+ Display --indent 2 --text "- Check services at startup (rc${sRUNLEVEL}.d)" --result "${STATUS_DONE}" --color WHITE
Display --indent 4 --text "Result: found ${COUNT} services"
LogText "Result: found ${COUNT} services"
fi
Describe the bug
Ubuntu 18.04 is using systemd for controlling services.
On a default AWS EC2 instance the runlevel command returns 'N 5' which causes the BOOT-5180 test to fail
Version
Expected behavior
It's unclear if I should just disable this test, or if it should still function correctly at 'runlevel 5'
Additional context
I'm not sure when I started seeing this message, I'm running Lynis on Ubuntu 18.04 I run the audit system from a cronjob and then grep the lynis-report.dat for suggestion entries.
Performing test ID BOOT-5180 (Check for Linux boot services (Debian style))
suggestion[]=BOOT-5180|Determine runlevel and services at startup|-|-|
The code is different now, but the result is similar. The runlevel returns 'N 5' which results in the "Determine runlevel and services at startup" message.
or:
Originally posted by @arcticlinux in #61 (comment)
The text was updated successfully, but these errors were encountered: