diff -urN e-smith-ntp-2.6.0.old/createlinks e-smith-ntp-2.6.0/createlinks --- e-smith-ntp-2.6.0.old/createlinks 2020-09-22 19:19:21.000000001 +0400 +++ e-smith-ntp-2.6.0/createlinks 2020-11-14 12:36:11.509946279 +0400 @@ -19,7 +19,7 @@ # Configuration template expansion of ntp.conf foreach my $file ( - qw(/etc/ntp/step-tickers /etc/ntp.conf /var/service/ntpd/env/MEMLIMIT)) + qw(/etc/ntp/step-tickers /etc/ntp.conf /usr/lib//systemd/system/ntpd.service.d/50koozali.conf)) { templates2events($file, qw( timeserver-update @@ -57,9 +57,22 @@ event_link("conf-timezone", $event, "04"); -# Link smbd and nmbd to daemontools. -safe_symlink("../daemontools", "root/etc/rc.d/init.d/supervise/ntpd"); +#-------------------------------------------------- +# actions for e-smith-ntp-update event +#-------------------------------------------------- -service_link_enhanced("ntpd", "S80", "7"); -safe_symlink("../init.d/supervise/ntpd", "root/etc/rc.d/rc6.d/K26ntpd"); -safe_symlink("../init.d/supervise/ntpd", "root/etc/rc.d/rc0.d/K26ntpd"); +$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)) +{ + templates2events( $file, $event ); +} + +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"); +safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/rsyslog"); +safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/squid"); +safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith"); diff -urN 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 1970-01-01 04:00:00.000000000 +0400 +++ e-smith-ntp-2.6.0/root/etc/e-smith/templates/usr/lib//systemd/system/ntpd.service.d/50koozali.conf/50MemoryLimit 2020-11-14 23:24:56.964745677 +0400 @@ -0,0 +1,18 @@ +{ + # 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 -urN e-smith-ntp-2.6.0.old/root/etc/e-smith/templates/var/service/ntpd/env/MEMLIMIT e-smith-ntp-2.6.0/root/etc/e-smith/templates/var/service/ntpd/env/MEMLIMIT --- e-smith-ntp-2.6.0.old/root/etc/e-smith/templates/var/service/ntpd/env/MEMLIMIT 2016-02-06 02:20:09.000000001 +0400 +++ e-smith-ntp-2.6.0/root/etc/e-smith/templates/var/service/ntpd/env/MEMLIMIT 1970-01-01 04:00:00.000000000 +0400 @@ -1,14 +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 = $ntpd{MemLimit} || MIN_MEMORY_LIMIT; -} - diff -urN 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 1970-01-01 04:00:00.000000000 +0400 +++ e-smith-ntp-2.6.0/root/usr/lib//systemd/system/ntpd.service.d/50koozali.conf 2020-11-14 11:10:29.000000001 +0400 @@ -0,0 +1,2 @@ +[Service] +MemoryLimit=250000 diff -urN 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 1970-01-01 04:00:00.000000000 +0400 +++ e-smith-ntp-2.6.0/root/etc/systemd/system-preset/80-koozali-ntp.preset 2020-11-14 10:18:52.000000001 +0400 @@ -0,0 +1,2 @@ +enable ntpdate.service +enable ntpd.service diff -urN e-smith-ntp-2.6.0.old/root/var/service/ntpd/log/run e-smith-ntp-2.6.0/root/var/service/ntpd/log/run --- e-smith-ntp-2.6.0.old/root/var/service/ntpd/log/run 2004-01-22 01:44:46.000000001 +0400 +++ e-smith-ntp-2.6.0/root/var/service/ntpd/log/run 1970-01-01 04:00:00.000000000 +0400 @@ -1,25 +0,0 @@ -#!/bin/sh -#---------------------------------------------------------------------- -# copyright (C) 1999-2003 Mitel Networks Corporation -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# Technical support for this program is available from Mitel Networks -# Please visit our web site www.mitel.com for details. -#---------------------------------------------------------------------- -exec \ - /usr/local/bin/setuidgid smelog \ - /usr/local/bin/multilog t s5000000 \ - /var/log/ntpd diff -urN e-smith-ntp-2.6.0.old/root/var/service/ntpd/run e-smith-ntp-2.6.0/root/var/service/ntpd/run --- e-smith-ntp-2.6.0.old/root/var/service/ntpd/run 2008-10-07 21:36:26.000000001 +0400 +++ e-smith-ntp-2.6.0/root/var/service/ntpd/run 1970-01-01 04:00:00.000000000 +0400 @@ -1,36 +0,0 @@ -#!/bin/sh -#---------------------------------------------------------------------- -# copyright (C) 1999-2004 Mitel Networks Corporation -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# Technical support for this program is available from Mitel Networks -# Please visit our web site www.mitel.com for details. -#---------------------------------------------------------------------- - -exec 2>&1 -# Remove old pid file if one exists -rm -f /var/run/ntpd.pid - -test -f /etc/ntp.conf || /sbin/e-smith/expand-template /etc/ntp.conf - -# 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 - -MEM="`head -1 ./env/MEMLIMIT`" -exec /usr/local/bin/softlimit -m ${MEM} \ - ntpd -n -l /dev/stdout