diff options
author | Michael Boelen <michael.boelen@cisofy.com> | 2017-08-17 21:28:32 +0300 |
---|---|---|
committer | Michael Boelen <michael.boelen@cisofy.com> | 2017-08-17 21:28:32 +0300 |
commit | 00648a636c35aa93099c95b29e72a92fd2c3dea2 (patch) | |
tree | 272d16fdbcf175285cdf250f1cc7a7aac282a2ad /lynis | |
parent | c0a6aaf855f5994605d46d8d2b5def5d194bec2b (diff) |
Improve systemd detection
Diffstat (limited to 'lynis')
-rwxr-xr-x | lynis | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -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 # |