diff options
Diffstat (limited to 'include/tests_time')
-rw-r--r-- | include/tests_time | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/include/tests_time b/include/tests_time index eda41a6f..0d1d65cb 100644 --- a/include/tests_time +++ b/include/tests_time @@ -22,7 +22,7 @@ # ################################################################################# # - InsertSection "Time and Synchronization" + InsertSection "${SECTION_TIME_AND_SYNCHRONIZATION}" # ################################################################################# # @@ -86,7 +86,7 @@ # Reason: openntpd syncs only if large time corrections are not required or -s is passed. # This might be not intended by the administrator (-s is NOT the default!) FIND=$(${PSBINARY} ax | ${GREPBINARY} "ntpd: ntp engine" | ${GREPBINARY} -v "grep") - # Status code 0 is when communication over the socket is successfull + # Status code 0 is when communication over the socket is successful if ${NTPCTLBINARY} -s status > /dev/null 2> /dev/null; then FOUND=1; NTP_DAEMON_RUNNING=1; NTP_CONFIG_TYPE_DAEMON=1; NTP_DAEMON="openntpd" LogText "result: found openntpd (method: ntpctl)" @@ -97,7 +97,7 @@ FOUND=1; NTP_DAEMON_RUNNING=1; NTP_CONFIG_TYPE_DAEMON=1; NTP_DAEMON="openntpd" LogText "result: found openntpd (method: ps)" else - LogText "result: running openntpd not found, but ntpctl is instaalled" + LogText "result: running openntpd not found, but ntpctl is installed" fi if [ "${NTP_DAEMON}" = "openntpd" ]; then @@ -106,7 +106,7 @@ fi # Check running processes (ntpd from ntp.org) - # As checking by process name is ambigiouse (openntpd has the same process name), + # As checking by process name is ambiguous (openntpd has the same process name), # this check will be skipped if openntpd has been found. FIND=$(${PSBINARY} ax | ${GREPBINARY} "ntpd" | ${GREPBINARY} -v "dntpd" | ${GREPBINARY} -v "ntpd: " | ${GREPBINARY} -v "grep") if [ "${NTP_DAEMON}" != "openntpd" ] && [ -n "${FIND}" ]; then @@ -575,7 +575,16 @@ Register --test-no TIME-3185 --preqs-met "${PREQS_MET}" --weight L --network NO --category "security" --description "Check systemd-timesyncd synchronized time" SYNCHRONIZED_FILE="/run/systemd/timesync/synchronized" + if [ ${SKIPTEST} -eq 0 ]; then + # On earlier systemd versions (237), '/run/systemd/timesync/synchronized' does not exist, so use '/var/lib/systemd/timesync/clock' + if [ ! -e "${SYNCHRONIZED_FILE}" ]; then + SYNCHRONIZED_FILE="/var/lib/systemd/timesync/clock" + fi + # DynamicUser=yes moves the clock file to '/var/lib/private/systemd/timesync/clock' + if [ ! -e "${SYNCHRONIZED_FILE}" ]; then + SYNCHRONIZED_FILE="/var/lib/private/systemd/timesync/clock" + fi if [ -e "${SYNCHRONIZED_FILE}" ]; then FIND=$(( $(date +%s) - $(${STATBINARY} -L --format %Y "${SYNCHRONIZED_FILE}") )) # Check if last sync was more than 2048 seconds (= the default of systemd) ago |