/[smeserver]/rpms/e-smith-ntp/sme10/e-smith-ntp-2.6.0-bz11008-bz8881-improve-systemd-driftfile.patch
ViewVC logotype

Annotation of /rpms/e-smith-ntp/sme10/e-smith-ntp-2.6.0-bz11008-bz8881-improve-systemd-driftfile.patch

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


Revision 1.3 - (hide annotations) (download)
Fri Nov 27 04:40:47 2020 UTC (4 years ago) by jpp
Branch: MAIN
Changes since 1.2: +2 -1 lines
* Thu Nov 26 2020 Jean-Philipe Pialasse <tests@pialasse.com> 2.6.0-7.sme
- improve systemd integration [SME: 11008]
- change driftfile path [SME: 8881]

1 jpp 1.1 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
2     --- e-smith-ntp-2.6.0.old/root/etc/e-smith/templates/etc/ntp.conf/30driftfile 2005-06-23 19:19:22.000000000 -0400
3     +++ e-smith-ntp-2.6.0/root/etc/e-smith/templates/etc/ntp.conf/30driftfile 2020-11-26 22:54:12.666000000 -0500
4     @@ -1,3 +1,3 @@
5     {
6     - $OUT = "driftfile /etc/ntp/drift";
7     + $OUT = "driftfile /var/lib/drift";
8     }
9     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
10     --- 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
11     +++ 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
12     @@ -0,0 +1,20 @@
13     +[Service]
14     +{
15     + # memory limit to catch any memory leak before it kills the system
16     + use constant MIN_MEMORY_LIMIT => 35000000;
17     +
18     + # If there is a memory limit in the database and it is below the minimum, delete it.
19     + if (defined $ntpd{MemLimit} && $ntpd{MemLimit} < MIN_MEMORY_LIMIT)
20     + {
21     + $DB->get_prop_and_delete('ntpd','MemLimit');
22     + delete $ntpd{MemLimit};
23     + }
24     +
25     + $OUT .= "MemoryLimit=";
26     + $OUT .= $ntpd{MemLimit} || MIN_MEMORY_LIMIT;
27     + $OUT .= "\n";
28     +
29     +}
30     +ExecStartPre=-/sbin/e-smith/expand-template /etc/ntp.conf
31     +ExecStartPre=-/sbin/e-smith/systemd/initializedate
32     +
33     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
34     --- 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
35     +++ 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
36     @@ -1,18 +0,0 @@
37     -{
38     - # memory limit to catch any memory leak before it kills the system
39     - use constant MIN_MEMORY_LIMIT => 35000000;
40     -
41     - # If there is a memory limit in the database and it is below the minimum, delete it.
42     - if (defined $ntpd{MemLimit} && $ntpd{MemLimit} < MIN_MEMORY_LIMIT)
43     - {
44     - $DB->get_prop_and_delete('ntpd','MemLimit');
45     - delete $ntpd{MemLimit};
46     - }
47     -
48     - $OUT = "[Service]\n";
49     - $OUT .= "MemoryLimit=";
50     - $OUT .= $ntpd{MemLimit} || MIN_MEMORY_LIMIT;
51     - $OUT .= "\n";
52     -
53     -}
54     -
55     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
56     --- e-smith-ntp-2.6.0.old/root/sbin/e-smith/systemd/initializedate 1969-12-31 19:00:00.000000000 -0500
57     +++ e-smith-ntp-2.6.0/root/sbin/e-smith/systemd/initializedate 2020-11-26 23:10:27.667000000 -0500
58     @@ -0,0 +1,19 @@
59     +#!/bin/bash
60     +#first move old drift file if in the way
61     +OLDFILE='/etc/ntp/drift'
62     +NEWFILE='/var/lib/ntp/drift'
63     +if [ -f "$NEWFILE" ]; then
64     + if [ -f "$OLDFILE" ];then
65     + /usr/bin/rm -f $OLDFILE
66     + fi
67     +else
68     + if [ -f "$OLDFILE" ];then
69     + /usr/bin/mv $OLDFILE $NEWFILE
70     + fi
71     +fi
72     +/usr/bin/chown ntp:ntp $NEWFILE
73     +
74     +# Run ntpdate so we're not way off on startup.
75     +ntpstep=/etc/ntp/step-tickers
76     +tickers=`/bin/sed -e 's/\#.*$//g' $ntpstep`
77     +/usr/sbin/ntpdate -b -p 8 $tickers
78 jpp 1.2 diff -Nur e-smith-ntp-2.6.0.old/createlinks e-smith-ntp-2.6.0/createlinks
79     --- e-smith-ntp-2.6.0.old/createlinks 2020-11-26 23:15:25.616000000 -0500
80     +++ e-smith-ntp-2.6.0/createlinks 2020-11-26 23:28:33.145000000 -0500
81     @@ -63,11 +63,12 @@
82    
83     $event = "e-smith-ntp-update";
84    
85     -foreach my $file (qw(/etc/ntp/step-tickers /etc/ntp.conf /usr/lib//systemd/system/ntpd.service.d/50koozali.conf))
86     +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))
87     {
88     templates2events( $file, $event );
89     }
90    
91     +event_link("systemd-default", $event, "10");
92     event_link("conf-timezone", $event, "30");
93     event_link("set-time-date", $event, "40");
94     event_link("systemd-reload", $event, "50");
95     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
96     --- 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
97     +++ 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
98 jpp 1.3 @@ -0,0 +1,14 @@
99 jpp 1.2 +# nut UPS specific subservices
100     +{
101     +my $status = $ntp{status} || 'disabled';
102     +
103     +if ($status eq 'enabled') {
104     + $OUT .= "disable ntpdate.service";
105     + $OUT .= "enable ntpd.service";
106     + }
107     +else
108     + {
109     + $OUT .= "disable ntpdate.service";
110     + $OUT .= "disable ntpd.service";
111     + }
112 jpp 1.3 +}
113 jpp 1.2 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
114     --- 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
115     +++ 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
116     @@ -0,0 +1,2 @@
117     +[Install]
118     +WantedBy=sme-server.target
119     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
120     --- e-smith-ntp-2.6.0.old/root/etc/systemd/system-preset/80-koozali-ntp.preset 2020-11-26 23:15:25.618000000 -0500
121     +++ e-smith-ntp-2.6.0/root/etc/systemd/system-preset/80-koozali-ntp.preset 1969-12-31 19:00:00.000000000 -0500
122     @@ -1,2 +0,0 @@
123     -enable ntpdate.service
124     -enable ntpd.service

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