From 2b4559690f388b7e2e869ab92d18555223390368 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Thu, 7 Jul 2016 11:37:10 +0200 Subject: [PATCH 13/15] scripts/fix-date: emit a log when the date is forced It's important to notify the user during the boot and to keep a trace in the logs when the date is wrong at boot time, because it usually indicates a dead battery. --- sbin/fix-date | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sbin/fix-date b/sbin/fix-date index 1bfd4da..02f631d 100644 --- a/sbin/fix-date +++ b/sbin/fix-date @@ -1,4 +1,7 @@ #!/bin/sh if [ /proc/self/. -ot /usr/share/factory/version ]; then /bin/date -s "$(/bin/date -r /usr/share/factory/version)" >/dev/null 2>/dev/null + msg="Replacing incorrect system date ($date) with build date ($(/bin/date))." + echo "WARNING: $msg" + logger -p warning "$msg" >/dev/null 2>&1 fi -- 1.7.12.1