initial commit of file from CVS for e-smith-ntp on Wed 12 Jul 09:00:21 BST 2023
This commit is contained in:
8
root/etc/e-smith/templates/etc/logrotate.d/ntpd/10All
Normal file
8
root/etc/e-smith/templates/etc/logrotate.d/ntpd/10All
Normal file
@@ -0,0 +1,8 @@
|
||||
/var/log/ntp.log \{
|
||||
missingok
|
||||
weekly
|
||||
rotate 24
|
||||
compress
|
||||
notifempty
|
||||
copytruncate
|
||||
\}
|
19
root/etc/e-smith/templates/etc/ntp.conf/00timeServer
Normal file
19
root/etc/e-smith/templates/etc/ntp.conf/00timeServer
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
# vim: ft=perl:
|
||||
my $server = $ntpd{NTPServer} || '';
|
||||
return "# sync to hw clock" if $server =~ m#^\s*$#;
|
||||
|
||||
if ( ($ntpd{'SupportLargeDrift'} || 'disabled') eq 'enabled' ){
|
||||
$OUT .= "tinker panic 0\n";
|
||||
}
|
||||
|
||||
if ($server =~ /pool.ntp.org/)
|
||||
{
|
||||
# The 0, 1, 2, 3 prefixes ensure NTP pool round-robin
|
||||
$OUT .= "server $_.$server\n" for (0..3);
|
||||
}
|
||||
else
|
||||
{
|
||||
$OUT .= "server $server\n";
|
||||
}
|
||||
}
|
9
root/etc/e-smith/templates/etc/ntp.conf/10localhost
Executable file
9
root/etc/e-smith/templates/etc/ntp.conf/10localhost
Executable file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
$OUT = '';
|
||||
unless ( ($ntpd{'SupportLargeDrift'} || 'disabled') eq 'enabled' ){
|
||||
$OUT .= <<EOF;
|
||||
server 127.127.1.0 # local clock
|
||||
fudge 127.127.1.0 stratum 10
|
||||
EOF
|
||||
}
|
||||
}
|
3
root/etc/e-smith/templates/etc/ntp.conf/30driftfile
Normal file
3
root/etc/e-smith/templates/etc/ntp.conf/30driftfile
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
$OUT = "driftfile /var/lib/ntp/drift";
|
||||
}
|
2
root/etc/e-smith/templates/etc/ntp.conf/40noquery
Normal file
2
root/etc/e-smith/templates/etc/ntp.conf/40noquery
Normal file
@@ -0,0 +1,2 @@
|
||||
restrict default noquery
|
||||
|
1
root/etc/e-smith/templates/etc/ntp.conf/41allowLocalHost
Normal file
1
root/etc/e-smith/templates/etc/ntp.conf/41allowLocalHost
Normal file
@@ -0,0 +1 @@
|
||||
restrict 127.0.0.1
|
19
root/etc/e-smith/templates/etc/ntp/step-tickers/00timeServer
Normal file
19
root/etc/e-smith/templates/etc/ntp/step-tickers/00timeServer
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
my $NTPenabled = $ntpd{'status'} || 'disabled';
|
||||
my $server = $ntpd{NTPServer} || '';
|
||||
if ($NTPenabled eq 'enabled')
|
||||
{
|
||||
if ($server =~ /pool.ntp.org/)
|
||||
{
|
||||
$OUT .= "0.$server";
|
||||
}
|
||||
else
|
||||
{
|
||||
$OUT .= "$server";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$OUT .= "# ntpd service is disabled";
|
||||
}
|
||||
}
|
4
root/etc/e-smith/templates/etc/rsyslog.conf/32ntp
Normal file
4
root/etc/e-smith/templates/etc/rsyslog.conf/32ntp
Normal file
@@ -0,0 +1,4 @@
|
||||
#ntp
|
||||
:programname, isequal, "ntpd" /var/log/ntp.log
|
||||
& stop
|
||||
|
5
root/etc/e-smith/templates/etc/sysconfig/clock/30clock
Normal file
5
root/etc/e-smith/templates/etc/sysconfig/clock/30clock
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
my $timezone = $TimeZone || "US/Eastern";
|
||||
|
||||
$OUT .= "ZONE=\"$timezone\"";
|
||||
}
|
3
root/etc/e-smith/templates/etc/sysconfig/clock/40UTC
Normal file
3
root/etc/e-smith/templates/etc/sysconfig/clock/40UTC
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
$OUT .= "UTC=true";
|
||||
}
|
3
root/etc/e-smith/templates/etc/sysconfig/clock/50ARC
Normal file
3
root/etc/e-smith/templates/etc/sysconfig/clock/50ARC
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
$OUT .= "ARC=false";
|
||||
}
|
@@ -0,0 +1,4 @@
|
||||
# nut ntpd specific subservices
|
||||
# this would conflict with ntpd
|
||||
disable ntpdate.service
|
||||
|
@@ -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
|
||||
Restart=always
|
@@ -0,0 +1,2 @@
|
||||
[Install]
|
||||
WantedBy=sme-server.target
|
Reference in New Issue
Block a user