Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CISOfy/lynis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lynis
diff options
context:
space:
mode:
authorMichael Boelen <michael.boelen@cisofy.com>2017-08-17 21:28:32 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2017-08-17 21:28:32 +0300
commit00648a636c35aa93099c95b29e72a92fd2c3dea2 (patch)
tree272d16fdbcf175285cdf250f1cc7a7aac282a2ad /lynis
parentc0a6aaf855f5994605d46d8d2b5def5d194bec2b (diff)
Improve systemd detection
Diffstat (limited to 'lynis')
-rwxr-xr-xlynis15
1 files changed, 12 insertions, 3 deletions
diff --git a/lynis b/lynis
index b26cd266..28edfda4 100755
--- a/lynis
+++ b/lynis
@@ -783,13 +783,22 @@ ${NORMAL}
#
#################################################################################
#
- # Check for systemd presence
- if [ -d ${ROOTDIR}lib/systemd/system -a -f ${ROOTDIR}usr/lib/systemd/systemd ]; then
+ # Check for systemd presence (already tested via binaries: systemctl)
+ if [ ${HAS_SYSTEMD} -eq 0 ]; then
+ FOUND=0
+ # Backup option to do additional testing for systemd
+ LIST="${ROOTDIR}lib/systemd/system"; for ITEM in ${LIST}; do if [ -d ${ITEM} ]; then FOUND=1; break; fi; done
+ LIST="${ROOTDIR}usr/lib/systemd/systemd"
+ if [ ${FOUND} -eq 0 ]; then for ITEM in ${LIST}; do if [ -f ${ITEM} ]; then FOUND=1; break; fi; done; fi
+ else
+ FOUND=1
+ fi
+ if [ ${FOUND} -eq 1 ]; then
LogText "Result: systemd is using systemd"
HAS_SYSTEMD=1
Report "systemd=1"
else
- LogText "Result: systemd not found, or partially"
+ LogText "Result: systemd not found"
Report "systemd=0"
fi
#