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
diff options
context:
space:
mode:
authorMichael Boelen <michael.boelen@cisofy.com>2016-10-19 12:28:20 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2016-10-19 12:28:20 +0300
commitf18ef5c21029ba47773ad604a1c15ef26a3859c5 (patch)
tree5548cae65aed74eb2ee1167a60e3e3e1e6216ee8 /include/tests_time
parentfc23e3cb243efd9345ad11e0f1f95286145c7433 (diff)
[TIME-3104] extended support for Chrony
Diffstat (limited to 'include/tests_time')
-rw-r--r--include/tests_time13
1 files changed, 11 insertions, 2 deletions
diff --git a/include/tests_time b/include/tests_time
index cd76b2d9..9597dca8 100644
--- a/include/tests_time
+++ b/include/tests_time
@@ -27,6 +27,7 @@
#################################################################################
#
CRON_DIRS="/etc/cron.d /etc/cron.hourly /etc/cron.daily /etc/cron.weekly /etc/cron.monthly /var/spool/crontabs"
+ CHRONY_CONF_FILE=""
NTP_DAEMON=""
NTP_DAEMON_RUNNING=0
NTP_CONFIG_FOUND=0
@@ -42,7 +43,7 @@
# Test : TIME-3104
# Description : Check for a running NTP daemon
if [ -f /sys/hypervisor/type ]; then
- # Skip NTP tests if we are in a DomU xen instance YYY
+ # TODO: Skip NTP tests if we are in a DomU xen instance
FIND=$(cat /sys/hypervisor/type)
if [ "${FIND}" = "xen" ]; then PREQS_MET="NO"; else PREQS_MET="YES"; fi
elif [ -f /sbin/sysctl ] && [ "`/sbin/sysctl -n security.jail.jailed 2>/dev/null || echo 0`" -eq 1 ]; then
@@ -57,12 +58,20 @@
LogText "Test: Searching for a running NTP daemon or available client"
FOUND=0
- if [ -f /etc/chrony.conf ]; then
+ SEARCH_FILES="${ROOTDIR}etc/chrony.conf ${ROOTDIR}etc/chrony/chrony.conf"
+ for FILE in ${SEARCH_FILES}; do
+ if [ -f ${FILE} ]; then LogText "result: found chrony configuration: ${FILE}"; CHRONY_CONF_FILE="${FILE}"; fi
+ done
+ if [ ! -z "${CHRONY_CONF_FILE}" ]; then
IsRunning chronyd
if [ ${RUNNING} -eq 1 ]; then
FOUND=1; NTP_DAEMON_RUNNING=1; NTP_CONFIG_TYPE_DAEMON=1; NTP_DAEMON="chronyd"
Display --indent 2 --text "- NTP daemon found: chronyd" --result "${STATUS_FOUND}" --color GREEN
+ else
+ LogText "Result: found chrony configuration, but no running daemon"
fi
+ else
+ LogText "Result: no chrony configuration found"
fi
# Check time daemon (eg DragonFly BSD)