mirror of
https://github.com/CISOfy/lynis.git
synced 2025-07-28 08:14:10 +02:00
Merge pull request #1013 from Jimver/timesyncd_fix
[TIME-3185]: Change timesyncd synchronization file
This commit is contained in:
commit
8e07c3e9dc
@ -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"
|
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"
|
SYNCHRONIZED_FILE="/run/systemd/timesync/synchronized"
|
||||||
|
|
||||||
if [ ${SKIPTEST} -eq 0 ]; then
|
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
|
if [ -e "${SYNCHRONIZED_FILE}" ]; then
|
||||||
FIND=$(( $(date +%s) - $(${STATBINARY} -L --format %Y "${SYNCHRONIZED_FILE}") ))
|
FIND=$(( $(date +%s) - $(${STATBINARY} -L --format %Y "${SYNCHRONIZED_FILE}") ))
|
||||||
# Check if last sync was more than 2048 seconds (= the default of systemd) ago
|
# Check if last sync was more than 2048 seconds (= the default of systemd) ago
|
||||||
|
Loading…
x
Reference in New Issue
Block a user