Merge ~andreserl/maas:chrony_packaging_snap into maas:master

Proposed by Andres Rodriguez
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 (community) Approve
MAAS Lander Approve
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.
Revision history for this message
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
Revision history for this message
Blake Rouse (blake-rouse) wrote :

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

review: Approve
Revision history for this message
Andres Rodriguez (andreserl) :
Revision history for this message
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

Package & snap chrony changes

97c7783... by Andres Rodriguez

Core changes for chrony

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/debian/control b/debian/control
index 1cc60c5..19fe921 100644
--- a/debian/control
+++ b/debian/control
@@ -75,7 +75,7 @@ Depends: bind9utils,
75 maas-cli (=${binary:Version}),75 maas-cli (=${binary:Version}),
76 maas-common (= ${binary:Version}),76 maas-common (= ${binary:Version}),
77 maas-proxy (= ${binary:Version}),77 maas-proxy (= ${binary:Version}),
78 ntp,78 chrony,
79 python3-bson,79 python3-bson,
80 python3-django,80 python3-django,
81 python3-django-maas (= ${binary:Version}),81 python3-django-maas (= ${binary:Version}),
@@ -88,7 +88,7 @@ Depends: bind9utils,
88 ubuntu-keyring,88 ubuntu-keyring,
89 ${misc:Depends},89 ${misc:Depends},
90 ${python3:Depends}90 ${python3:Depends}
91Conflicts: maas-region-controller-min91Conflicts: maas-region-controller-min, ntp
92Replaces: maas-region-controller-min92Replaces: maas-region-controller-min
93Provides: maas-region-controller-min93Provides: maas-region-controller-min
94Description: Region controller API service for MAAS94Description: Region controller API service for MAAS
@@ -204,7 +204,7 @@ Depends: authbind,
204 maas-cli (=${binary:Version}),204 maas-cli (=${binary:Version}),
205 maas-common (=${binary:Version}),205 maas-common (=${binary:Version}),
206 maas-dhcp (=${binary:Version}),206 maas-dhcp (=${binary:Version}),
207 ntp,207 chrony,
208 pxelinux | syslinux-common (<< 3:6.00~pre4+dfsg-5),208 pxelinux | syslinux-common (<< 3:6.00~pre4+dfsg-5),
209 python3-httplib2,209 python3-httplib2,
210 python3-maas-provisioningserver (=${binary:Version}),210 python3-maas-provisioningserver (=${binary:Version}),
@@ -220,7 +220,7 @@ Depends: authbind,
220 ${python3:Depends}220 ${python3:Depends}
221Recommends: libvirt-clients221Recommends: libvirt-clients
222Suggests: amtterm, ipmitool, nmap, wsmancli222Suggests: amtterm, ipmitool, nmap, wsmancli
223Conflicts: tftpd-hpa223Conflicts: tftpd-hpa, ntp
224Breaks: python-maas-provisioningserver,224Breaks: python-maas-provisioningserver,
225 maas-cluster-controller225 maas-cluster-controller
226Replaces: python-maas-provisioningserver,226Replaces: python-maas-provisioningserver,
diff --git a/debian/extras/99-maas-common-sudoers b/debian/extras/99-maas-common-sudoers
index 8aedc86..5429069 100644
--- a/debian/extras/99-maas-common-sudoers
+++ b/debian/extras/99-maas-common-sudoers
@@ -7,9 +7,9 @@ maas ALL= NOPASSWD: /usr/lib/maas/beacon-monitor
77
8# Control of the NTP server: MAAS needs to reconfigure it after editing8# Control of the NTP server: MAAS needs to reconfigure it after editing
9# its configuration file, and start it again if stopped manually.9# its configuration file, and start it again if stopped manually.
10maas ALL= NOPASSWD: /bin/systemctl restart ntp10maas ALL= NOPASSWD: /bin/systemctl restart chrony
11maas ALL= NOPASSWD: /bin/systemctl start ntp11maas ALL= NOPASSWD: /bin/systemctl start chrony
12maas ALL= NOPASSWD: /bin/systemctl status ntp12maas ALL= NOPASSWD: /bin/systemctl status chrony
1313
14# Writing and deleting files as root.14# Writing and deleting files as root.
15maas ALL= NOPASSWD: /usr/lib/maas/maas-delete-file15maas ALL= NOPASSWD: /usr/lib/maas/maas-delete-file
diff --git a/debian/maas-common.dirs b/debian/maas-common.dirs
index a780b08..6d72826 100644
--- a/debian/maas-common.dirs
+++ b/debian/maas-common.dirs
@@ -1,3 +1,2 @@
1var/log/maas1var/log/maas
2var/lib/maas2var/lib/maas
3etc/ntp
diff --git a/snap/bin/run-ntpd b/snap/bin/run-chronyd
index 5144073..e91c561 100755
--- a/snap/bin/run-ntpd
+++ b/snap/bin/run-chronyd
@@ -5,13 +5,13 @@
5set -e5set -e
66
7# Create the required directories.7# Create the required directories.
8mkdir -p $SNAP_DATA/etc/ntp8mkdir -p $SNAP_DATA/etc/chrony
9mkdir -p $SNAP_COMMON/log/ntpstats9mkdir -p $SNAP_COMMON/log/ntpstats
1010
11# Copy the initial ntp.conf if it doesn't exist.11# Copy the initial ntp.conf if it doesn't exist.
12if [ ! -e "$SNAP_DATA/etc/ntp.conf" ]; then12if [ ! -e "$SNAP_DATA/etc/chrony/chrony.conf" ]; then
13 cp "$SNAP/usr/share/maas/ntp.conf" "$SNAP_DATA/etc/ntp.conf"13 cp "$SNAP/usr/share/maas/chrony.conf" "$SNAP_DATA/etc/chrony/chrony.conf"
14fi14fi
1515
16# Run ntpd.16# Run ntpd.
17exec $SNAP/usr/sbin/ntpd -n -d -c "$SNAP_DATA/etc/ntp.conf"17exec $SNAP/usr/sbin/chronyd -d -f "$SNAP_DATA/etc/chrony/chrony.conf"
diff --git a/snap/conf/chrony.conf b/snap/conf/chrony.conf
18new file mode 10064418new file mode 100644
index 0000000..f9b2fa2
--- /dev/null
+++ b/snap/conf/chrony.conf
@@ -0,0 +1,38 @@
1# Welcome to the chrony configuration file. See chrony.conf(5) for more
2# information about usuable directives.
3
4# Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board
5# on 2011-02-08 (LP: #104525). See http://www.pool.ntp.org/join.html for
6# more information.
7pool 0.ubuntu.pool.ntp.org iburst
8pool 1.ubuntu.pool.ntp.org iburst
9pool 2.ubuntu.pool.ntp.org iburst
10pool 3.ubuntu.pool.ntp.org iburst
11
12# Use Ubuntu's ntp server as a fallback.
13pool ntp.ubuntu.com
14
15# This directive specify the location of the file containing ID/key pairs for
16# NTP authentication.
17keyfile /var/snap/maas/current/etc/chrony/chrony.keys
18
19# This directive specify the file into which chronyd will store the rate
20# information.
21driftfile /var/snap/maas/current/var/lib/chrony/chrony.drift
22
23# Uncomment the following line to turn logging on.
24#log tracking measurements statistics
25
26# Log files location.
27logdir /var/snap/maas/current/var/log/chrony
28
29# Stop bad estimates upsetting machine clock.
30maxupdateskew 100.0
31
32# This directive enables kernel synchronisation (every 11 minutes) of the
33# real-time clock. Note that it can’t be used along with the 'rtcfile' directive.
34rtcsync
35
36# Step the system clock instead of slewing it if the adjustment is larger than
37# one second, but only in the first three clock updates.
38makestep 1 3
diff --git a/snap/conf/ntp.conf b/snap/conf/ntp.conf
0deleted file mode 10064439deleted file mode 100644
index 8a0d50e..0000000
--- a/snap/conf/ntp.conf
+++ /dev/null
@@ -1,65 +0,0 @@
1# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help
2
3driftfile /var/snap/maas/current/etc/ntp/ntp.drift
4
5# Enable this if you want statistics to be logged.
6statsdir /var/snap/maas/common/log/ntpstats/
7
8statistics loopstats peerstats clockstats
9filegen loopstats file loopstats type day enable
10filegen peerstats file peerstats type day enable
11filegen clockstats file clockstats type day enable
12
13# Specify one or more NTP servers.
14
15# Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board
16# on 2011-02-08 (LP: #104525). See http://www.pool.ntp.org/join.html for
17# more information.
18pool 0.ubuntu.pool.ntp.org iburst
19pool 1.ubuntu.pool.ntp.org iburst
20pool 2.ubuntu.pool.ntp.org iburst
21pool 3.ubuntu.pool.ntp.org iburst
22
23# Use Ubuntu's ntp server as a fallback.
24pool ntp.ubuntu.com
25
26# Access control configuration; see /usr/share/doc/ntp-doc/html/accopt.html for
27# details. The web page <http://support.ntp.org/bin/view/Support/AccessRestrictions>
28# might also be helpful.
29#
30# Note that "restrict" applies to both servers and clients, so a configuration
31# that might be intended to block requests from certain clients could also end
32# up blocking replies from your own upstream servers.
33
34# By default, exchange time with everybody, but don't allow configuration.
35restrict -4 default kod notrap nomodify nopeer noquery limited
36restrict -6 default kod notrap nomodify nopeer noquery limited
37
38# Local users may interrogate the ntp server more closely.
39restrict 127.0.0.1
40restrict ::1
41
42# Needed for adding pool entries
43restrict source notrap nomodify noquery
44
45# Clients from this (example!) subnet have unlimited access, but only if
46# cryptographically authenticated.
47#restrict 192.168.123.0 mask 255.255.255.0 notrust
48
49# If you want to provide time to your local subnet, change the next line.
50# (Again, the address is an example only.)
51#broadcast 192.168.123.255
52
53# If you want to listen to time broadcasts on your local subnet, de-comment the
54# next lines. Please do this only if you trust everybody on the network!
55#disable auth
56#broadcastclient
57
58#Changes recquired to use pps synchonisation as explained in documentation:
59#http://www.ntp.org/ntpfaq/NTP-s-config-adv.htm#AEN3918
60
61#server 127.127.8.1 mode 135 prefer # Meinberg GPS167 with PPS
62#fudge 127.127.8.1 time1 0.0042 # relative to PPS for my hardware
63
64#server 127.127.22.1 # ATOM(PPS)
65#fudge 127.127.22.1 flag3 1 # enable PPS API
diff --git a/snap/conf/supervisord.conf.template b/snap/conf/supervisord.conf.template
index f7d1da8..758aff2 100644
--- a/snap/conf/supervisord.conf.template
+++ b/snap/conf/supervisord.conf.template
@@ -92,9 +92,9 @@ stdout_logfile=%(ENV_SNAP_COMMON)s/log/dhcpd6.log
92{{if rackd or regiond}}92{{if rackd or regiond}}
93[program:ntp]93[program:ntp]
94process_name=ntp94process_name=ntp
95command=%(ENV_SNAP)s/bin/run-ntpd95command=%(ENV_SNAP)s/bin/run-chronyd
96stopasgroup=true96stopasgroup=true
97killasgroup=true97killasgroup=true
98redirect_stderr=true98redirect_stderr=true
99stdout_logfile=%(ENV_SNAP_COMMON)s/log/ntp.log99stdout_logfile=%(ENV_SNAP_COMMON)s/log/chrony.log
100{{endif}}100{{endif}}
diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml
index ffb1c52..07d6283 100644
--- a/snap/snapcraft.yaml
+++ b/snap/snapcraft.yaml
@@ -52,7 +52,7 @@ parts:
52 - libjs-yui3-full52 - libjs-yui3-full
53 - libjs-yui3-min53 - libjs-yui3-min
54 - lshw54 - lshw
55 - ntp55 - chrony
56 - openssh-client56 - openssh-client
57 - postgresql57 - postgresql
58 - python3-bson58 - python3-bson
@@ -136,7 +136,7 @@ parts:
136 source: snap136 source: snap
137 organize:137 organize:
138 bind: usr/share/maas/bind138 bind: usr/share/maas/bind
139 conf/ntp.conf: usr/share/maas/ntp.conf139 conf/chrony.conf: usr/share/maas/chrony.conf
140 conf/supervisord.conf.template: usr/share/maas/supervisord.conf.template140 conf/supervisord.conf.template: usr/share/maas/supervisord.conf.template
141 stage:141 stage:
142 - -conf142 - -conf

Subscribers

People subscribed via source and target branches