diff options
author | mslifcak <slifcan@gmail.com> | 2018-01-17 17:56:19 +0300 |
---|---|---|
committer | Michael Boelen <michael.boelen@cisofy.com> | 2018-01-17 17:56:19 +0300 |
commit | 173843bdfd009f856aca8c37b1c06d3ff5bea5e6 (patch) | |
tree | 1cae61d1f9dc0caf8c3db496e5bfcb95093a44a0 /lynis | |
parent | bc571054c4de724811e6aa47347a028f323c1a39 (diff) |
Pin svc mgr (#506)
* systemctl does not mean systemd is used
* Check for systemd active
* determine service manager if not already set
Diffstat (limited to 'lynis')
-rwxr-xr-x | lynis | 14 |
1 files changed, 3 insertions, 11 deletions
@@ -788,22 +788,14 @@ ${NORMAL} # ################################################################################# # - # 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 + # Check for systemd active + if [ -d /run/systemd/system ]; then LogText "Result: system is using systemd" HAS_SYSTEMD=1 Report "systemd=1" else LogText "Result: systemd not found" + HAS_SYSTEMD=0 Report "systemd=0" fi # |