diff options
author | Simon Biewald <simon@fam-biewald.de> | 2020-08-19 23:47:09 +0300 |
---|---|---|
committer | Simon Biewald <simon@fam-biewald.de> | 2020-08-19 23:47:09 +0300 |
commit | bd7131f6db22c17569d0ce24f75e1d4595c473c3 (patch) | |
tree | 59ed5e76a2d11f8949ca8b1eebcf09fb2f6b65c3 /include/tests_accounting | |
parent | 7df0b8618b5cce39961b245a3c582af4294276d7 (diff) |
Detect sysstat systemd unit
Diffstat (limited to 'include/tests_accounting')
-rw-r--r-- | include/tests_accounting | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/include/tests_accounting b/include/tests_accounting index 91fca1a0..354bef6b 100644 --- a/include/tests_accounting +++ b/include/tests_accounting @@ -123,8 +123,19 @@ Display --indent 2 --text "- Checking sysstat accounting data" --result "${STATUS_DISABLED}" --color WHITE ReportSuggestion "${TEST_NO}" "Enable sysstat to collect accounting (cron disabled)" fi + elif [ -f "${ROOTDIR}lib/systemd/system/sysstat.service" ] || [ -f "${ROOTDIR}etc/systemd/system/sysstat.service" ]; then + LogText "Result: sysstat systemd unit found" + if [ -L "${ROOTDIR}etc/systemd/system/multi-user.target.wants/sysstat.service" ]; then + # Assuming -collect.timer and -summary.timer are enabled as well, + # as they are usually in the install section. + LogText "Result: sysstat enabled via systemd" + Display --indent 2 --text "- Checking sysstat accounting data" --result "${STATUS_ENABLED}" --color GREEN + else + LogText "Result: sysstat disabled via systemd" + Display --indent 2 --text "- Checking sysstat accounting data" --result "${STATUS_DISABLED}" --color WHITE + fi else - LogText "Result: sysstat not found via ${ROOTDIR}etc/default/sysstat or ${ROOTDIR}etc/cron.d/sysstat" + LogText "Result: sysstat not found via ${ROOTDIR}etc/default/sysstat or ${ROOTDIR}etc/cron.d/sysstat or as a systemd unit" Display --indent 2 --text "- Checking sysstat accounting data" --result "${STATUS_NOT_FOUND}" --color YELLOW ReportSuggestion "${TEST_NO}" "Enable sysstat to collect accounting (no results)" fi |