Merge ~andreserl/maas:chrony_packaging_snap into maas:master

Proposed by Andres Rodriguez on 2018-02-26
Status: Superseded
Proposed branch: ~andreserl/maas:chrony_packaging_snap
Merge into: maas:master
Prerequisite: ~andreserl/maas:chrony
Diff against target: 240 lines (+53/-81)
8 files modified
debian/control (+4/-4)
debian/extras/99-maas-common-sudoers (+3/-3)
debian/maas-common.dirs (+0/-1)
dev/null (+0/-65)
snap/bin/run-chronyd (+4/-4)
snap/conf/chrony.conf (+38/-0)
snap/conf/supervisord.conf.template (+2/-2)
snap/snapcraft.yaml (+2/-2)
Reviewer Review Type Date Requested Status
Blake Rouse 2018-02-26 Approve on 2018-02-26
MAAS Lander Approve on 2018-02-26
Review via email: mp+339707@code.launchpad.net

This proposal has been superseded by a proposal from 2018-02-26.

Commit message

Update packaging and snap changes to support chrony.

To post a comment you must log in.
MAAS Lander (maas-lander) wrote :

UNIT TESTS
-b chrony_packaging_snap lp:~andreserl/maas/+git/maas into -b master lp:~maas-committers/maas

STATUS: SUCCESS
COMMIT: 5d0588852a2a99b8a2e91e7eab10b593e70f2420

review: Approve
Blake Rouse (blake-rouse) wrote :

Looks good. Just one question, but not going to block you. I assume its not needed.

review: Approve
Andres Rodriguez (andreserl) wrote :

Chrony transition [1] and this branch have been approved.

I'm re-proposing this PR without a pre-req so both changes land in a single branch and test together in the CI.

[1]: https://code.launchpad.net/~andreserl/maas/+git/maas/+merge/339706

Unmerged commits

5d05888... by Andres Rodriguez on 2018-02-26

Package & snap chrony changes

97c7783... by Andres Rodriguez on 2018-02-26

Core changes for chrony

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/control b/debian/control
2index 1cc60c5..19fe921 100644
3--- a/debian/control
4+++ b/debian/control
5@@ -75,7 +75,7 @@ Depends: bind9utils,
6 maas-cli (=${binary:Version}),
7 maas-common (= ${binary:Version}),
8 maas-proxy (= ${binary:Version}),
9- ntp,
10+ chrony,
11 python3-bson,
12 python3-django,
13 python3-django-maas (= ${binary:Version}),
14@@ -88,7 +88,7 @@ Depends: bind9utils,
15 ubuntu-keyring,
16 ${misc:Depends},
17 ${python3:Depends}
18-Conflicts: maas-region-controller-min
19+Conflicts: maas-region-controller-min, ntp
20 Replaces: maas-region-controller-min
21 Provides: maas-region-controller-min
22 Description: Region controller API service for MAAS
23@@ -204,7 +204,7 @@ Depends: authbind,
24 maas-cli (=${binary:Version}),
25 maas-common (=${binary:Version}),
26 maas-dhcp (=${binary:Version}),
27- ntp,
28+ chrony,
29 pxelinux | syslinux-common (<< 3:6.00~pre4+dfsg-5),
30 python3-httplib2,
31 python3-maas-provisioningserver (=${binary:Version}),
32@@ -220,7 +220,7 @@ Depends: authbind,
33 ${python3:Depends}
34 Recommends: libvirt-clients
35 Suggests: amtterm, ipmitool, nmap, wsmancli
36-Conflicts: tftpd-hpa
37+Conflicts: tftpd-hpa, ntp
38 Breaks: python-maas-provisioningserver,
39 maas-cluster-controller
40 Replaces: python-maas-provisioningserver,
41diff --git a/debian/extras/99-maas-common-sudoers b/debian/extras/99-maas-common-sudoers
42index 8aedc86..5429069 100644
43--- a/debian/extras/99-maas-common-sudoers
44+++ b/debian/extras/99-maas-common-sudoers
45@@ -7,9 +7,9 @@ maas ALL= NOPASSWD: /usr/lib/maas/beacon-monitor
46
47 # Control of the NTP server: MAAS needs to reconfigure it after editing
48 # its configuration file, and start it again if stopped manually.
49-maas ALL= NOPASSWD: /bin/systemctl restart ntp
50-maas ALL= NOPASSWD: /bin/systemctl start ntp
51-maas ALL= NOPASSWD: /bin/systemctl status ntp
52+maas ALL= NOPASSWD: /bin/systemctl restart chrony
53+maas ALL= NOPASSWD: /bin/systemctl start chrony
54+maas ALL= NOPASSWD: /bin/systemctl status chrony
55
56 # Writing and deleting files as root.
57 maas ALL= NOPASSWD: /usr/lib/maas/maas-delete-file
58diff --git a/debian/maas-common.dirs b/debian/maas-common.dirs
59index a780b08..6d72826 100644
60--- a/debian/maas-common.dirs
61+++ b/debian/maas-common.dirs
62@@ -1,3 +1,2 @@
63 var/log/maas
64 var/lib/maas
65-etc/ntp
66diff --git a/snap/bin/run-ntpd b/snap/bin/run-chronyd
67index 5144073..e91c561 100755
68--- a/snap/bin/run-ntpd
69+++ b/snap/bin/run-chronyd
70@@ -5,13 +5,13 @@
71 set -e
72
73 # Create the required directories.
74-mkdir -p $SNAP_DATA/etc/ntp
75+mkdir -p $SNAP_DATA/etc/chrony
76 mkdir -p $SNAP_COMMON/log/ntpstats
77
78 # Copy the initial ntp.conf if it doesn't exist.
79-if [ ! -e "$SNAP_DATA/etc/ntp.conf" ]; then
80- cp "$SNAP/usr/share/maas/ntp.conf" "$SNAP_DATA/etc/ntp.conf"
81+if [ ! -e "$SNAP_DATA/etc/chrony/chrony.conf" ]; then
82+ cp "$SNAP/usr/share/maas/chrony.conf" "$SNAP_DATA/etc/chrony/chrony.conf"
83 fi
84
85 # Run ntpd.
86-exec $SNAP/usr/sbin/ntpd -n -d -c "$SNAP_DATA/etc/ntp.conf"
87+exec $SNAP/usr/sbin/chronyd -d -f "$SNAP_DATA/etc/chrony/chrony.conf"
88diff --git a/snap/conf/chrony.conf b/snap/conf/chrony.conf
89new file mode 100644
90index 0000000..f9b2fa2
91--- /dev/null
92+++ b/snap/conf/chrony.conf
93@@ -0,0 +1,38 @@
94+# Welcome to the chrony configuration file. See chrony.conf(5) for more
95+# information about usuable directives.
96+
97+# Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board
98+# on 2011-02-08 (LP: #104525). See http://www.pool.ntp.org/join.html for
99+# more information.
100+pool 0.ubuntu.pool.ntp.org iburst
101+pool 1.ubuntu.pool.ntp.org iburst
102+pool 2.ubuntu.pool.ntp.org iburst
103+pool 3.ubuntu.pool.ntp.org iburst
104+
105+# Use Ubuntu's ntp server as a fallback.
106+pool ntp.ubuntu.com
107+
108+# This directive specify the location of the file containing ID/key pairs for
109+# NTP authentication.
110+keyfile /var/snap/maas/current/etc/chrony/chrony.keys
111+
112+# This directive specify the file into which chronyd will store the rate
113+# information.
114+driftfile /var/snap/maas/current/var/lib/chrony/chrony.drift
115+
116+# Uncomment the following line to turn logging on.
117+#log tracking measurements statistics
118+
119+# Log files location.
120+logdir /var/snap/maas/current/var/log/chrony
121+
122+# Stop bad estimates upsetting machine clock.
123+maxupdateskew 100.0
124+
125+# This directive enables kernel synchronisation (every 11 minutes) of the
126+# real-time clock. Note that it can’t be used along with the 'rtcfile' directive.
127+rtcsync
128+
129+# Step the system clock instead of slewing it if the adjustment is larger than
130+# one second, but only in the first three clock updates.
131+makestep 1 3
132diff --git a/snap/conf/ntp.conf b/snap/conf/ntp.conf
133deleted file mode 100644
134index 8a0d50e..0000000
135--- a/snap/conf/ntp.conf
136+++ /dev/null
137@@ -1,65 +0,0 @@
138-# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help
139-
140-driftfile /var/snap/maas/current/etc/ntp/ntp.drift
141-
142-# Enable this if you want statistics to be logged.
143-statsdir /var/snap/maas/common/log/ntpstats/
144-
145-statistics loopstats peerstats clockstats
146-filegen loopstats file loopstats type day enable
147-filegen peerstats file peerstats type day enable
148-filegen clockstats file clockstats type day enable
149-
150-# Specify one or more NTP servers.
151-
152-# Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board
153-# on 2011-02-08 (LP: #104525). See http://www.pool.ntp.org/join.html for
154-# more information.
155-pool 0.ubuntu.pool.ntp.org iburst
156-pool 1.ubuntu.pool.ntp.org iburst
157-pool 2.ubuntu.pool.ntp.org iburst
158-pool 3.ubuntu.pool.ntp.org iburst
159-
160-# Use Ubuntu's ntp server as a fallback.
161-pool ntp.ubuntu.com
162-
163-# Access control configuration; see /usr/share/doc/ntp-doc/html/accopt.html for
164-# details. The web page <http://support.ntp.org/bin/view/Support/AccessRestrictions>
165-# might also be helpful.
166-#
167-# Note that "restrict" applies to both servers and clients, so a configuration
168-# that might be intended to block requests from certain clients could also end
169-# up blocking replies from your own upstream servers.
170-
171-# By default, exchange time with everybody, but don't allow configuration.
172-restrict -4 default kod notrap nomodify nopeer noquery limited
173-restrict -6 default kod notrap nomodify nopeer noquery limited
174-
175-# Local users may interrogate the ntp server more closely.
176-restrict 127.0.0.1
177-restrict ::1
178-
179-# Needed for adding pool entries
180-restrict source notrap nomodify noquery
181-
182-# Clients from this (example!) subnet have unlimited access, but only if
183-# cryptographically authenticated.
184-#restrict 192.168.123.0 mask 255.255.255.0 notrust
185-
186-# If you want to provide time to your local subnet, change the next line.
187-# (Again, the address is an example only.)
188-#broadcast 192.168.123.255
189-
190-# If you want to listen to time broadcasts on your local subnet, de-comment the
191-# next lines. Please do this only if you trust everybody on the network!
192-#disable auth
193-#broadcastclient
194-
195-#Changes recquired to use pps synchonisation as explained in documentation:
196-#http://www.ntp.org/ntpfaq/NTP-s-config-adv.htm#AEN3918
197-
198-#server 127.127.8.1 mode 135 prefer # Meinberg GPS167 with PPS
199-#fudge 127.127.8.1 time1 0.0042 # relative to PPS for my hardware
200-
201-#server 127.127.22.1 # ATOM(PPS)
202-#fudge 127.127.22.1 flag3 1 # enable PPS API
203diff --git a/snap/conf/supervisord.conf.template b/snap/conf/supervisord.conf.template
204index f7d1da8..758aff2 100644
205--- a/snap/conf/supervisord.conf.template
206+++ b/snap/conf/supervisord.conf.template
207@@ -92,9 +92,9 @@ stdout_logfile=%(ENV_SNAP_COMMON)s/log/dhcpd6.log
208 {{if rackd or regiond}}
209 [program:ntp]
210 process_name=ntp
211-command=%(ENV_SNAP)s/bin/run-ntpd
212+command=%(ENV_SNAP)s/bin/run-chronyd
213 stopasgroup=true
214 killasgroup=true
215 redirect_stderr=true
216-stdout_logfile=%(ENV_SNAP_COMMON)s/log/ntp.log
217+stdout_logfile=%(ENV_SNAP_COMMON)s/log/chrony.log
218 {{endif}}
219diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml
220index ffb1c52..07d6283 100644
221--- a/snap/snapcraft.yaml
222+++ b/snap/snapcraft.yaml
223@@ -52,7 +52,7 @@ parts:
224 - libjs-yui3-full
225 - libjs-yui3-min
226 - lshw
227- - ntp
228+ - chrony
229 - openssh-client
230 - postgresql
231 - python3-bson
232@@ -136,7 +136,7 @@ parts:
233 source: snap
234 organize:
235 bind: usr/share/maas/bind
236- conf/ntp.conf: usr/share/maas/ntp.conf
237+ conf/chrony.conf: usr/share/maas/chrony.conf
238 conf/supervisord.conf.template: usr/share/maas/supervisord.conf.template
239 stage:
240 - -conf

Subscribers

People subscribed via source and target branches