diff -Nur e-smith-ntp-2.6.0.old/root/etc/e-smith/templates/etc/ntp.conf/30driftfile e-smith-ntp-2.6.0/root/etc/e-smith/templates/etc/ntp.conf/30driftfile --- e-smith-ntp-2.6.0.old/root/etc/e-smith/templates/etc/ntp.conf/30driftfile 2005-06-23 19:19:22.000000000 -0400 +++ e-smith-ntp-2.6.0/root/etc/e-smith/templates/etc/ntp.conf/30driftfile 2020-11-26 22:54:12.666000000 -0500 @@ -1,3 +1,3 @@ { - $OUT = "driftfile /etc/ntp/drift"; + $OUT = "driftfile /var/lib/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 +++ e-smith-ntp-2.6.0/root/etc/e-smith/templates/usr/lib/systemd/system/ntpd.service.d/50koozali.conf/40service 2020-11-26 22:56:27.760000000 -0500 @@ -0,0 +1,20 @@ +[Service] +{ + # memory limit to catch any memory leak before it kills the system + use constant MIN_MEMORY_LIMIT => 35000000; + + # If there is a memory limit in the database and it is below the minimum, delete it. + if (defined $ntpd{MemLimit} && $ntpd{MemLimit} < MIN_MEMORY_LIMIT) + { + $DB->get_prop_and_delete('ntpd','MemLimit'); + delete $ntpd{MemLimit}; + } + + $OUT .= "MemoryLimit="; + $OUT .= $ntpd{MemLimit} || MIN_MEMORY_LIMIT; + $OUT .= "\n"; + +} +ExecStartPre=-/sbin/e-smith/expand-template /etc/ntp.conf +ExecStartPre=-/sbin/e-smith/systemd/initializedate + diff -Nur e-smith-ntp-2.6.0.old/root/etc/e-smith/templates/usr/lib/systemd/system/ntpd.service.d/50koozali.conf/50MemoryLimit e-smith-ntp-2.6.0/root/etc/e-smith/templates/usr/lib/systemd/system/ntpd.service.d/50koozali.conf/50MemoryLimit --- e-smith-ntp-2.6.0.old/root/etc/e-smith/templates/usr/lib/systemd/system/ntpd.service.d/50koozali.conf/50MemoryLimit 2020-11-26 21:25:12.992000000 -0500 +++ e-smith-ntp-2.6.0/root/etc/e-smith/templates/usr/lib/systemd/system/ntpd.service.d/50koozali.conf/50MemoryLimit 1969-12-31 19:00:00.000000000 -0500 @@ -1,18 +0,0 @@ -{ - # memory limit to catch any memory leak before it kills the system - use constant MIN_MEMORY_LIMIT => 35000000; - - # If there is a memory limit in the database and it is below the minimum, delete it. - if (defined $ntpd{MemLimit} && $ntpd{MemLimit} < MIN_MEMORY_LIMIT) - { - $DB->get_prop_and_delete('ntpd','MemLimit'); - delete $ntpd{MemLimit}; - } - - $OUT = "[Service]\n"; - $OUT .= "MemoryLimit="; - $OUT .= $ntpd{MemLimit} || MIN_MEMORY_LIMIT; - $OUT .= "\n"; - -} - 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 @@ +#!/bin/bash +#first move old drift file if in the way +OLDFILE='/etc/ntp/drift' +NEWFILE='/var/lib/ntp/drift' +if [ -f "$NEWFILE" ]; then + if [ -f "$OLDFILE" ];then + /usr/bin/rm -f $OLDFILE + fi +else + if [ -f "$OLDFILE" ];then + /usr/bin/mv $OLDFILE $NEWFILE + fi +fi +/usr/bin/chown ntp:ntp $NEWFILE + +# Run ntpdate so we're not way off on startup. +ntpstep=/etc/ntp/step-tickers +tickers=`/bin/sed -e 's/\#.*$//g' $ntpstep` +/usr/sbin/ntpdate -b -p 8 $tickers 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:15:25.616000000 -0500 +++ e-smith-ntp-2.6.0/createlinks 2020-11-26 23:28:33.145000000 -0500 @@ -63,11 +63,12 @@ $event = "e-smith-ntp-update"; -foreach my $file (qw(/etc/ntp/step-tickers /etc/ntp.conf /usr/lib//systemd/system/ntpd.service.d/50koozali.conf)) +foreach my $file (qw(/etc/ntp/step-tickers /etc/ntp.conf /usr/lib//systemd/system/ntpd.service.d/50koozali.conf /etc/systemd/system-preset/49-koozali.preset)) { templates2events( $file, $event ); } +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"); 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 +++ e-smith-ntp-2.6.0/root/etc/e-smith/templates/etc/systemd/system-preset/49-koozali.preset/80-koozali-ntp.preset 2020-11-26 23:22:46.951000000 -0500 @@ -0,0 +1,14 @@ +# nut UPS specific subservices +{ +my $status = $ntp{status} || 'disabled'; + +if ($status eq 'enabled') { + $OUT .= "disable ntpdate.service"; + $OUT .= "enable ntpd.service"; + } +else + { + $OUT .= "disable ntpdate.service"; + $OUT .= "disable ntpd.service"; + } +} 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 --- e-smith-ntp-2.6.0.old/root/etc/e-smith/templates/usr/lib/systemd/system/ntpd.service.d/50koozali.conf/80install 1969-12-31 19:00:00.000000000 -0500 +++ e-smith-ntp-2.6.0/root/etc/e-smith/templates/usr/lib/systemd/system/ntpd.service.d/50koozali.conf/80install 2020-11-26 23:26:16.570000000 -0500 @@ -0,0 +1,2 @@ +[Install] +WantedBy=sme-server.target diff -Nur e-smith-ntp-2.6.0.old/root/etc/systemd/system-preset/80-koozali-ntp.preset e-smith-ntp-2.6.0/root/etc/systemd/system-preset/80-koozali-ntp.preset --- e-smith-ntp-2.6.0.old/root/etc/systemd/system-preset/80-koozali-ntp.preset 2020-11-26 23:15:25.618000000 -0500 +++ e-smith-ntp-2.6.0/root/etc/systemd/system-preset/80-koozali-ntp.preset 1969-12-31 19:00:00.000000000 -0500 @@ -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