/[smeserver]/rpms/e-smith-ntp/sme10/e-smith-ntp-2.6.0-bz11008_systemd.patch
ViewVC logotype

Contents of /rpms/e-smith-ntp/sme10/e-smith-ntp-2.6.0-bz11008_systemd.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Mon Nov 16 16:34:00 2020 UTC (3 years, 11 months ago) by michel
Branch: MAIN
CVS Tags: e-smith-ntp-2_6_0-6_el7_sme
* Wed Sep 23 2020 Michel Begue <mab974@gmail.com> 2.6.0-6.sme
- from service to systemd [SME: 11008]
- add ntpd-update event [SME: 11009]

1 diff -urN e-smith-ntp-2.6.0.old/createlinks e-smith-ntp-2.6.0/createlinks
2 --- e-smith-ntp-2.6.0.old/createlinks 2020-09-22 19:19:21.000000001 +0400
3 +++ e-smith-ntp-2.6.0/createlinks 2020-11-14 12:36:11.509946279 +0400
4 @@ -19,7 +19,7 @@
5
6 # Configuration template expansion of ntp.conf
7 foreach my $file (
8 - qw(/etc/ntp/step-tickers /etc/ntp.conf /var/service/ntpd/env/MEMLIMIT))
9 + qw(/etc/ntp/step-tickers /etc/ntp.conf /etc/systemd/system/ntpd.service.d/override.conf))
10 {
11 templates2events($file, qw(
12 timeserver-update
13 @@ -57,9 +57,22 @@
14
15 event_link("conf-timezone", $event, "04");
16
17 -# Link smbd and nmbd to daemontools.
18 -safe_symlink("../daemontools", "root/etc/rc.d/init.d/supervise/ntpd");
19 +#--------------------------------------------------
20 +# actions for e-smith-ntp-update event
21 +#--------------------------------------------------
22
23 -service_link_enhanced("ntpd", "S80", "7");
24 -safe_symlink("../init.d/supervise/ntpd", "root/etc/rc.d/rc6.d/K26ntpd");
25 -safe_symlink("../init.d/supervise/ntpd", "root/etc/rc.d/rc0.d/K26ntpd");
26 +$event = "e-smith-ntp-update";
27 +
28 +foreach my $file (qw(/etc/ntp/step-tickers /etc/ntp.conf /etc/systemd/system/ntpd.service.d/50koozali.conf))
29 +{
30 + templates2events( $file, $event );
31 +}
32 +
33 +event_link("conf-timezone", $event, "30");
34 +event_link("set-time-date", $event, "40");
35 +event_link("systemd-reload", $event, "50");
36 +
37 +safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/ntpd");
38 +safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/rsyslog");
39 +safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/squid");
40 +safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith");
41 diff -urN e-smith-ntp-2.6.0.old/root/etc/e-smith/templates/etc/systemd/system/ntpd.service.d/50koozali.conf/50MemoryLimit e-smith-ntp-2.6.0/root/etc/e-smith/templates/etc/systemd/system/ntpd.service.d/50koozali.conf/50MemoryLimit
42 --- e-smith-ntp-2.6.0.old/root/etc/e-smith/templates/etc/systemd/system/ntpd.service.d/50koozali.conf/50MemoryLimit 1970-01-01 04:00:00.000000000 +0400
43 +++ e-smith-ntp-2.6.0/root/etc/e-smith/templates/etc/systemd/system/ntpd.service.d/50koozali.conf/50MemoryLimit 2020-11-14 23:24:56.964745677 +0400
44 @@ -0,0 +1,18 @@
45 +{
46 + # memory limit to catch any memory leak before it kills the system
47 + use constant MIN_MEMORY_LIMIT => 35000000;
48 +
49 + # If there is a memory limit in the database and it is below the minimum, delete it.
50 + if (defined $ntpd{MemLimit} && $ntpd{MemLimit} < MIN_MEMORY_LIMIT)
51 + {
52 + $DB->get_prop_and_delete('ntpd','MemLimit');
53 + delete $ntpd{MemLimit};
54 + }
55 +
56 + $OUT = "[Service]\n";
57 + $OUT .= "MemoryLimit=";
58 + $OUT .= $ntpd{MemLimit} || MIN_MEMORY_LIMIT;
59 + $OUT .= "\n";
60 +
61 +}
62 +
63 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
64 --- 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
65 +++ e-smith-ntp-2.6.0/root/etc/e-smith/templates/var/service/ntpd/env/MEMLIMIT 1970-01-01 04:00:00.000000000 +0400
66 @@ -1,14 +0,0 @@
67 -{
68 - # memory limit to catch any memory leak before it kills the system
69 - use constant MIN_MEMORY_LIMIT => 35000000;
70 -
71 - # If there is a memory limit in the database and it is below the minimum, delete it.
72 - if (defined $ntpd{MemLimit} && $ntpd{MemLimit} < MIN_MEMORY_LIMIT)
73 - {
74 - $DB->get_prop_and_delete('ntpd','MemLimit');
75 - delete $ntpd{MemLimit};
76 - }
77 -
78 - $OUT = $ntpd{MemLimit} || MIN_MEMORY_LIMIT;
79 -}
80 -
81 diff -urN e-smith-ntp-2.6.0.old/root/etc/systemd/system/ntpdate.service e-smith-ntp-2.6.0/root/etc/systemd/system/ntpdate.service
82 --- e-smith-ntp-2.6.0.old/root/etc/systemd/system/ntpdate.service 1970-01-01 04:00:00.000000000 +0400
83 +++ e-smith-ntp-2.6.0/root/etc/systemd/system/ntpdate.service 2020-11-14 11:06:30.000000001 +0400
84 @@ -0,0 +1,14 @@
85 +[Unit]
86 +Description=Set time via NTP (ntpdate)
87 +After=network-online.target nss-lookup.target
88 +Before=time-sync.target
89 +Wants=time-sync.target network-online.target
90 +
91 +[Service]
92 +Type=oneshot
93 +ExecStartPre=/sbin/e-smith/service-status ntpd
94 +ExecStart=/usr/libexec/ntpdate-wrapper
95 +RemainAfterExit=yes
96 +
97 +[Install]
98 +WantedBy=sme-server.target
99 diff -urN e-smith-ntp-2.6.0.old/root/etc/systemd/system/ntpd.service e-smith-ntp-2.6.0/root/etc/systemd/system/ntpd.service
100 --- e-smith-ntp-2.6.0.old/root/etc/systemd/system/ntpd.service 1970-01-01 04:00:00.000000000 +0400
101 +++ e-smith-ntp-2.6.0/root/etc/systemd/system/ntpd.service 2020-11-14 11:07:10.000000001 +0400
102 @@ -0,0 +1,13 @@
103 +[Unit]
104 +Description=Network Time Service (ntpd)
105 +After=syslog.target ntpdate.service sntp.service
106 +
107 +[Service]
108 +Type=forking
109 +EnvironmentFile=-/etc/sysconfig/ntpd
110 +ExecStartPre=/sbin/e-smith/service-status ntpd
111 +ExecStart=/usr/sbin/ntpd -u ntp:ntp $OPTIONS
112 +PrivateTmp=true
113 +
114 +[Install]
115 +WantedBy=sme-server.target
116 diff -urN e-smith-ntp-2.6.0.old/root/etc/systemd/system/ntpd.service.d/50koozali.conf e-smith-ntp-2.6.0/root/etc/systemd/system/ntpd.service.d/50koozali.conf
117 --- e-smith-ntp-2.6.0.old/root/etc/systemd/system/ntpd.service.d/50koozali.conf 1970-01-01 04:00:00.000000000 +0400
118 +++ e-smith-ntp-2.6.0/root/etc/systemd/system/ntpd.service.d/50koozali.conf 2020-11-14 11:10:29.000000001 +0400
119 @@ -0,0 +1,2 @@
120 +[Service]
121 +MemoryLimit=250000
122 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
123 --- e-smith-ntp-2.6.0.old/root/etc/systemd/system-preset/80-koozali-ntp.preset 1970-01-01 04:00:00.000000000 +0400
124 +++ e-smith-ntp-2.6.0/root/etc/systemd/system-preset/80-koozali-ntp.preset 2020-11-14 10:18:52.000000001 +0400
125 @@ -0,0 +1,2 @@
126 +enable ntpdate.service
127 +enable ntpd.service
128 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
129 --- e-smith-ntp-2.6.0.old/root/var/service/ntpd/log/run 2004-01-22 01:44:46.000000001 +0400
130 +++ e-smith-ntp-2.6.0/root/var/service/ntpd/log/run 1970-01-01 04:00:00.000000000 +0400
131 @@ -1,25 +0,0 @@
132 -#!/bin/sh
133 -#----------------------------------------------------------------------
134 -# copyright (C) 1999-2003 Mitel Networks Corporation
135 -#
136 -# This program is free software; you can redistribute it and/or modify
137 -# it under the terms of the GNU General Public License as published by
138 -# the Free Software Foundation; either version 2 of the License, or
139 -# (at your option) any later version.
140 -#
141 -# This program is distributed in the hope that it will be useful,
142 -# but WITHOUT ANY WARRANTY; without even the implied warranty of
143 -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
144 -# GNU General Public License for more details.
145 -#
146 -# You should have received a copy of the GNU General Public License
147 -# along with this program; if not, write to the Free Software
148 -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
149 -#
150 -# Technical support for this program is available from Mitel Networks
151 -# Please visit our web site www.mitel.com for details.
152 -#----------------------------------------------------------------------
153 -exec \
154 - /usr/local/bin/setuidgid smelog \
155 - /usr/local/bin/multilog t s5000000 \
156 - /var/log/ntpd
157 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
158 --- e-smith-ntp-2.6.0.old/root/var/service/ntpd/run 2008-10-07 21:36:26.000000001 +0400
159 +++ e-smith-ntp-2.6.0/root/var/service/ntpd/run 1970-01-01 04:00:00.000000000 +0400
160 @@ -1,36 +0,0 @@
161 -#!/bin/sh
162 -#----------------------------------------------------------------------
163 -# copyright (C) 1999-2004 Mitel Networks Corporation
164 -#
165 -# This program is free software; you can redistribute it and/or modify
166 -# it under the terms of the GNU General Public License as published by
167 -# the Free Software Foundation; either version 2 of the License, or
168 -# (at your option) any later version.
169 -#
170 -# This program is distributed in the hope that it will be useful,
171 -# but WITHOUT ANY WARRANTY; without even the implied warranty of
172 -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
173 -# GNU General Public License for more details.
174 -#
175 -# You should have received a copy of the GNU General Public License
176 -# along with this program; if not, write to the Free Software
177 -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
178 -#
179 -# Technical support for this program is available from Mitel Networks
180 -# Please visit our web site www.mitel.com for details.
181 -#----------------------------------------------------------------------
182 -
183 -exec 2>&1
184 -# Remove old pid file if one exists
185 -rm -f /var/run/ntpd.pid
186 -
187 -test -f /etc/ntp.conf || /sbin/e-smith/expand-template /etc/ntp.conf
188 -
189 -# Run ntpdate so we're not way off on startup.
190 -ntpstep=/etc/ntp/step-tickers
191 -tickers=`/bin/sed -e 's/\#.*$//g' $ntpstep`
192 -/usr/sbin/ntpdate -b -p 8 $tickers
193 -
194 -MEM="`head -1 ./env/MEMLIMIT`"
195 -exec /usr/local/bin/softlimit -m ${MEM} \
196 - ntpd -n -l /dev/stdout

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed