--- rpms/e-smith-ntp/sme10/e-smith-ntp-2.6.0-bz11008-bz8881-improve-systemd-driftfile.patch 2020/11/27 04:44:18 1.4 +++ rpms/e-smith-ntp/sme10/e-smith-ntp-2.6.0-bz11008-bz8881-improve-systemd-driftfile.patch 2023/02/06 06:58:10 1.11 @@ -4,7 +4,7 @@ diff -Nur e-smith-ntp-2.6.0.old/root/etc @@ -1,3 +1,3 @@ { - $OUT = "driftfile /etc/ntp/drift"; -+ $OUT = "driftfile /var/lib/drift"; ++ $OUT = "driftfile /var/lib/ntp/drift"; } diff -Nur e-smith-ntp-2.6.0.old/root/etc/e-smith/templates/usr/lib/systemd/system/ntpd.service.d/50koozali.conf/40service e-smith-ntp-2.6.0/root/etc/e-smith/templates/usr/lib/systemd/system/ntpd.service.d/50koozali.conf/40service --- e-smith-ntp-2.6.0.old/root/etc/e-smith/templates/usr/lib/systemd/system/ntpd.service.d/50koozali.conf/40service 1969-12-31 19:00:00.000000000 -0500 @@ -55,7 +55,7 @@ diff -Nur e-smith-ntp-2.6.0.old/root/etc diff -Nur e-smith-ntp-2.6.0.old/root/sbin/e-smith/systemd/initializedate e-smith-ntp-2.6.0/root/sbin/e-smith/systemd/initializedate --- e-smith-ntp-2.6.0.old/root/sbin/e-smith/systemd/initializedate 1969-12-31 19:00:00.000000000 -0500 +++ e-smith-ntp-2.6.0/root/sbin/e-smith/systemd/initializedate 2020-11-26 23:10:27.667000000 -0500 -@@ -0,0 +1,19 @@ +@@ -0,0 +1,21 @@ +#!/bin/bash +#first move old drift file if in the way +OLDFILE='/etc/ntp/drift' @@ -69,7 +69,9 @@ diff -Nur e-smith-ntp-2.6.0.old/root/sbi + /usr/bin/mv $OLDFILE $NEWFILE + fi +fi -+/usr/bin/chown ntp:ntp $NEWFILE ++if [ -f "$NEWFILE" ]; then ++ /usr/bin/chown ntp:ntp $NEWFILE ++fi + +# Run ntpdate so we're not way off on startup. +ntpstep=/etc/ntp/step-tickers @@ -90,8 +92,7 @@ diff -Nur e-smith-ntp-2.6.0.old/createli +event_link("systemd-default", $event, "10"); event_link("conf-timezone", $event, "30"); --event_link("set-time-date", $event, "40"); -+ + event_link("set-time-date", $event, "40"); event_link("systemd-reload", $event, "50"); diff -Nur e-smith-ntp-2.6.0.old/root/etc/e-smith/templates/etc/systemd/system-preset/49-koozali.preset/80-koozali-ntp.preset e-smith-ntp-2.6.0/root/etc/e-smith/templates/etc/systemd/system-preset/49-koozali.preset/80-koozali-ntp.preset --- e-smith-ntp-2.6.0.old/root/etc/e-smith/templates/etc/systemd/system-preset/49-koozali.preset/80-koozali-ntp.preset 1969-12-31 19:00:00.000000000 -0500 @@ -102,13 +103,13 @@ diff -Nur e-smith-ntp-2.6.0.old/root/etc +my $status = $ntp{status} || 'disabled'; + +if ($status eq 'enabled') { -+ $OUT .= "disable ntpdate.service"; -+ $OUT .= "enable ntpd.service"; ++ $OUT .= "disable ntpdate.service\n"; ++ $OUT .= "enable ntpd.service\n"; + } +else + { -+ $OUT .= "disable ntpdate.service"; -+ $OUT .= "disable ntpd.service"; ++ $OUT .= "disable ntpdate.service\n"; ++ $OUT .= "disable ntpd.service\n"; + } +} diff -Nur e-smith-ntp-2.6.0.old/root/etc/e-smith/templates/usr/lib/systemd/system/ntpd.service.d/50koozali.conf/80install e-smith-ntp-2.6.0/root/etc/e-smith/templates/usr/lib/systemd/system/ntpd.service.d/50koozali.conf/80install @@ -123,3 +124,41 @@ diff -Nur e-smith-ntp-2.6.0.old/root/etc @@ -1,2 +0,0 @@ -enable ntpdate.service -enable ntpd.service +diff -Nur e-smith-ntp-2.6.0.old/createlinks e-smith-ntp-2.6.0/createlinks +--- e-smith-ntp-2.6.0.old/createlinks 2020-11-26 23:49:32.684000000 -0500 ++++ e-smith-ntp-2.6.0/createlinks 2020-11-26 23:49:53.047000000 -0500 +@@ -70,7 +70,6 @@ + + event_link("systemd-default", $event, "10"); + event_link("conf-timezone", $event, "30"); +-event_link("set-time-date", $event, "40"); + event_link("systemd-reload", $event, "50"); + + safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/ntpd"); +diff -Nur e-smith-ntp-2.6.0.old/root/usr/lib/systemd/system/ntpd.service.d/50koozali.conf e-smith-ntp-2.6.0/root/usr/lib/systemd/system/ntpd.service.d/50koozali.conf +--- e-smith-ntp-2.6.0.old/root/usr/lib/systemd/system/ntpd.service.d/50koozali.conf 2020-11-26 23:56:30.134000000 -0500 ++++ e-smith-ntp-2.6.0/root/usr/lib/systemd/system/ntpd.service.d/50koozali.conf 1969-12-31 19:00:00.000000000 -0500 +@@ -1,2 +0,0 @@ +-[Service] +-MemoryLimit=250000 +diff -Nur e-smith-ntp-2.6.0.old/root/etc/e-smith/templates/etc/systemd/system-preset/49-koozali.preset/80-koozali-ntp.preset e-smith-ntp-2.6.0/root/etc/e-smith/templates/etc/systemd/system-preset/49-koozali.preset/80-koozali-ntp.preset +--- e-smith-ntp-2.6.0.old/root/etc/e-smith/templates/etc/systemd/system-preset/49-koozali.preset/80-koozali-ntp.preset 2020-11-27 09:37:05.531000000 -0500 ++++ e-smith-ntp-2.6.0/root/etc/e-smith/templates/etc/systemd/system-preset/49-koozali.preset/80-koozali-ntp.preset 2020-11-27 09:38:47.124000000 -0500 +@@ -1,14 +1,4 @@ +-# nut UPS specific subservices +-{ +-my $status = $ntp{status} || 'disabled'; ++# nut ntpd specific subservices ++# this would conflict with ntpd ++disable ntpdate.service + +-if ($status eq 'enabled') { +- $OUT .= "disable ntpdate.service\n"; +- $OUT .= "enable ntpd.service\n"; +- } +-else +- { +- $OUT .= "disable ntpdate.service\n"; +- $OUT .= "disable ntpd.service\n"; +- } +-}