summaryrefslogtreecommitdiff
path: root/source/n/ntp
diff options
context:
space:
mode:
Diffstat (limited to 'source/n/ntp')
-rw-r--r--source/n/ntp/doinst.sh12
-rwxr-xr-xsource/n/ntp/ntp.SlackBuild2
-rw-r--r--source/n/ntp/rc.ntpd15
3 files changed, 27 insertions, 2 deletions
diff --git a/source/n/ntp/doinst.sh b/source/n/ntp/doinst.sh
index 1e74ce44..bc542990 100644
--- a/source/n/ntp/doinst.sh
+++ b/source/n/ntp/doinst.sh
@@ -9,10 +9,20 @@ config() {
fi
# Otherwise, we leave the .new copy for the admin to consider...
}
+preserve_perms() {
+ NEW="$1"
+ OLD="$(dirname ${NEW})/$(basename ${NEW} .new)"
+ if [ -e ${OLD} ]; then
+ cp -a ${OLD} ${NEW}.incoming
+ cat ${NEW} > ${NEW}.incoming
+ mv ${NEW}.incoming ${NEW}
+ fi
+ config ${NEW}
+}
config etc/ntp.conf.new
config etc/ntp/ntp.keys.new
if [ -r etc/rc.d/rc.ntpd -a -r etc/rc.d/rc.ntpd.new ]; then
chmod --reference=etc/rc.d/rc.ntpd etc/rc.d/rc.ntpd.new
fi
-config etc/rc.d/rc.ntpd.new
+mv etc/rc.d/rc.ntpd.new etc/rc.d/rc.ntpd
diff --git a/source/n/ntp/ntp.SlackBuild b/source/n/ntp/ntp.SlackBuild
index d89863e7..f514aa6c 100755
--- a/source/n/ntp/ntp.SlackBuild
+++ b/source/n/ntp/ntp.SlackBuild
@@ -22,7 +22,7 @@
PKGNAM=ntp
VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
-BUILD=${BUILD:-2}
+BUILD=${BUILD:-4}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
diff --git a/source/n/ntp/rc.ntpd b/source/n/ntp/rc.ntpd
index 7cf3d50b..c1d1411c 100644
--- a/source/n/ntp/rc.ntpd
+++ b/source/n/ntp/rc.ntpd
@@ -7,6 +7,21 @@ ntpd_start() {
echo -n "Starting NTP daemon: $CMDLINE"
$CMDLINE -p /var/run/ntpd.pid
echo
+ # The kernel is now mocking around with the the hardware clock if
+ # ntpd is running, so if the hardware clock (wall clock) is set to
+ # 'localtime' execute hwclock --localtime --systohc to disable the
+ # 11 minute mode kernel function:
+ if [ -x /sbin/hwclock ]; then
+ # Check for a broken motherboard RTC clock (where ioports for rtc are
+ # unknown) to prevent hwclock causing a hang:
+ if ! grep -q -w rtc /proc/ioports ; then
+ CLOCK_OPT="--directisa"
+ fi
+ if ! grep -q "^UTC" /etc/hardwareclock 2> /dev/null ; then
+ echo "Saving system time to the hardware clock (localtime)."
+ /sbin/hwclock $CLOCK_OPT --localtime --systohc
+ fi
+ fi
}
# Stop ntpd: