Merge ~paelzer/ubuntu/+source/chrony:merge-3.5-eoan into ubuntu/+source/chrony:debian/sid

Proposed by Christian Ehrhardt 
Status: Merged
Approved by: Christian Ehrhardt 
Approved revision: f636f08af4823db78cc9c65bff3f92d48aa64f0a
Merge reported by: Christian Ehrhardt 
Merged at revision: f636f08af4823db78cc9c65bff3f92d48aa64f0a
Proposed branch: ~paelzer/ubuntu/+source/chrony:merge-3.5-eoan
Merge into: ubuntu/+source/chrony:debian/sid
Diff against target: 562 lines (+435/-4)
9 files modified
debian/README.container (+60/-0)
debian/changelog (+276/-0)
debian/chrony.conf (+18/-1)
debian/chrony.default (+4/-0)
debian/chrony.service (+2/-2)
debian/chronyd-starter.sh (+70/-0)
debian/control (+3/-1)
debian/docs (+1/-0)
debian/install (+1/-0)
Reviewer Review Type Date Requested Status
Rafael David Tinoco (community) Approve
Canonical Server Pending
Canonical Server packageset reviewers Pending
git-ubuntu developers Pending
Review via email: mp+370185@code.launchpad.net

This proposal supersedes a proposal from 2019-07-02.

To post a comment you must log in.
Revision history for this message
Christian Ehrhardt  (paelzer) wrote : Posted in a previous version of this proposal
Revision history for this message
Christian Ehrhardt  (paelzer) wrote : Posted in a previous version of this proposal

I forgot to activate non x86 builds, so I uploaded a no change rebuild to the PPA.
But as assumed all arches built fine.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote : Posted in a previous version of this proposal

Tested in a container and a VM for the service issues we had in the past.
Seems fine to me right now.

Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote : Posted in a previous version of this proposal

I'm on it.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote : Posted in a previous version of this proposal

Rebased to 3.5-2 which was just uploaded to Debian.
Need to also change the merge target to match LP diff preview

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Done, ready for review with the new content.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

New upload to PPA with the rebase to 3.5-2 done

Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote : Posted in a previous version of this proposal

Okay,

Checked LP numbers and descriptions, modified debian/ files through history, compiled, installed, de-installed, purged, upgraded, all good. Tested chronyd tracking:

$ chronyc tracking
Reference ID : C8A007C1 (gps.ntp.br)
Stratum : 3
Ref time (UTC) : Tue Jul 16 12:15:54 2019
System time : 0.000272425 seconds slow of NTP time
Last offset : -3.252692461 seconds
RMS offset : 3.252692461 seconds
Frequency : 21.290 ppm slow
Residual freq : -0.000 ppm
Skew : 42.520 ppm
Root delay : 0.009401247 seconds
Root dispersion : 0.004084035 seconds
Update interval : 64.4 seconds
Leap status : Normal

And ran autopkgtest. I had the same failures as previous versions were having, due to other unrelated (to this merge) things.

1) The systemd issue:
md5sum: /run/systemd/resolved.conf.d/isc-dhcp-v4-dummy0.conf: No such file or directory

2)

FAILED 2 (111-knownclient 112-port) (23644 23645 23646 23647 23648 23649 23650 23651 23652 23653 23654 23655 23656 23657 23658 23659 23660 23661 23662 23663 23644 23645 23646 23647 23648 23649 23650 23651 23652 23653 23654 23655 23656 23657 23658 23659 23660 23661 23662 23663 23662)

111-knownclient xxxxxxxxxxxxxxxxxxxx FAIL
112-port xxxxxxxxxxxxxxxxxxxx FAIL

(this also occurred in other tests for 3.4-4ubuntu2, since iproute2/4.18.0-1ubuntu3 triggered the test)

Are you aware of what caused this ^ ?

Anyway, I'm +1 on this merge since those tests were failing before it.

review: Approve
Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

Forgot to claim review from server team.

review: Approve
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Thanks for the review Rafael!

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Tagged, pushed and uploaded to Eoan

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

landed in Eoan

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/README.container b/debian/README.container
2new file mode 100644
3index 0000000..16f2618
4--- /dev/null
5+++ b/debian/README.container
6@@ -0,0 +1,60 @@
7+Chrony in Containers
8+--------------------
9+
10+Currently in in 99.9+% of the cases syncing the local clock in a container
11+is wrong. Most of the time it will be unable to do so, because it is lacking
12+CAP_SYS_TIME. Or worse, if the CAP_SYS_TIME privilege is granted, multiple
13+containers could fight over the system's time, because the Linux kernel does
14+not provide time namespaces (yet).
15+
16+There are two things a user installing chrony usually wants:
17+1. synchronize my time (NTP client)
18+2. serve NTP (NTP server)
19+
20+In a container the first makes (usually) no sense, so by default we enable -x
21+there (as it would only crash otherwise).
22+This will disable the control of the system clock.
23+See `man chronyd` for more details on the -x option.
24+
25+Formerly, the check for Condition=CAP_SYS_TIME in the systemd service avoided
26+the crash of the NTP client portion, but that means the server use case will
27+not work by default in containers. It is still not recommended to use a
28+container as an NTP server, but if the host clock is synchronised via NTP,
29+adding the -x option to chronyd instances running in containers will allow
30+them to function as NTP servers which do not adjust the system clock.
31+The Condition=CAP_SYS_TIME check was a silent, no-log-entry stealing away
32+leaving users often unclear what happened - especially if they were more after
33+the NTP server than the NTP client.
34+
35+One could argue that someone who installs chrony expects the system time to be
36+synchronised, so it should fail if it is not able to do so. On the other hand
37+it could be argued that someone who installs chrony expects time to be served
38+over the network via NTP.
39+We can't know which expectation is applicable, so we assume that time should
40+be synchronised unless chronyd is running in a container (or is without
41+CAP_SYS_TIME in any other environment).
42+
43+To make things worse recent container implementations will offer CAP_SYS_TIME
44+to the container. Since from the container's point of view, this capability is
45+available for the container's user namespace. Just later on adjtimex and similar
46+are actually evaluated against the host kernel where they will fail. Due to
47+that without further precaution running chrony in Ubuntu in the future will
48+likely have the service start (as Condition=CAP_SYS_TIME will be true) but
49+then immediately fail.
50+This will depend on the environment e.g. versions and types of containers and
51+thereby feel just 'unreliable' from users point of view.
52+Furthermore it will affect upgrades as the service has to be restarted for a
53+package upgrade to be considered complete.
54+
55+Due to all of that Ubuntu decided (LP: #1589780) to default to -x (do not
56+set the system clock) in containers.
57+
58+If one really wants to (try to) sync time in a container or CAP_SYS_TIME-less
59+environment set SYNC_IN_CONTAINER="yes" in /etc/default/chrony to disable
60+this special handling.
61+
62+It is important to mention that as soon as upstream provides a way to provide
63+a default config working in those cases Ubuntu intends to use that and drop
64+the current workaround.
65+
66+ -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Fri, 16 Mar 2018 12:25:44 +0100
67diff --git a/debian/changelog b/debian/changelog
68index f3c52fc..8177c32 100644
69--- a/debian/changelog
70+++ b/debian/changelog
71@@ -1,3 +1,36 @@
72+chrony (3.5-2ubuntu1) eoan; urgency=medium
73+
74+ * Merge with Debian experimental (LP: #1835046). Remaining changes:
75+ - d/chrony.conf: use ubuntu ntp pool and server (LP 1744664 1754358)
76+ - Set -x as default if unable to set time (e.g. in containers) (LP 1589780)
77+ Chrony is a single service which acts as both NTP client (i.e. syncing the
78+ local clock) and NTP server (i.e. providing NTP services to the network),
79+ and that is both desired and expected in the vast majority of cases.
80+ But in containers syncing the local clock is usually impossible, but this
81+ shall not break the providing of NTP services to the network.
82+ To some extent this makes chrony's default config more similar to 'ntpd',
83+ which complained in syslog but still provided NTP server service in those
84+ cases.
85+ + debian/chrony.service: allow the service to run without CAP_SYS_TIME
86+ + debian/control: add new dependency libcap2-bin for capsh (usually
87+ installed anyway, but make them explicit to be sure).
88+ + debian/chrony.default: new option SYNC_IN_CONTAINER to not fall back
89+ (Default off) [fixed a minor typo in the comment in this update]
90+ + debian/chronyd-starter.sh: wrapper to handle special cases in containers
91+ and if CAP_SYS_TIME is missing. Effectively allows to run NTP server in
92+ containers on a default installation and avoid failing to sync time (or
93+ if allowed to sync, avoid multiple containers to fight over it by
94+ accident).
95+ + debian/install: make chrony-starter.sh available on install.
96+ + debian/docs, debian/README.container: provide documentation about the
97+ handling of this case.
98+ * Dropped changes (accepted in Debian now):
99+ - d/postrm: re-establish systemd-timesyncd on removal (LP 1764357)
100+ - d/postrm: respect policy-rc.d when restoring systemd-timesyncd
101+ (LP 1771994)
102+
103+ -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Tue, 02 Jul 2019 13:37:23 +0200
104+
105 chrony (3.5-2) unstable; urgency=medium
106
107 * Merge branch “experimental” into “master”.
108@@ -84,6 +117,56 @@ chrony (3.5~pre1-1) experimental; urgency=medium
109
110 -- Vincent Blut <vincent.debian@free.fr> Sun, 12 May 2019 22:16:14 +0200
111
112+chrony (3.4-4ubuntu2) eoan; urgency=medium
113+
114+ * Dropped sysV change added in 3.4-4ubuntu1 (LP: #1829700):
115+ - removed d/init to avoid weird interactions between sysV and systemd
116+ [With debhelper compat level 12 this isn't an issue anymore]
117+
118+ -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Wed, 22 May 2019 09:10:41 +0200
119+
120+chrony (3.4-4ubuntu1) eoan; urgency=medium
121+
122+ * Merge with Debian unstable (LP: #1828992). Remaining changes:
123+ - d/chrony.conf: use ubuntu ntp pool and server (LP 1744664 1754358)
124+ - Set -x as default if unable to set time (e.g. in containers) (LP 1589780)
125+ Chrony is a single service which acts as both NTP client (i.e. syncing the
126+ local clock) and NTP server (i.e. providing NTP services to the network),
127+ and that is both desired and expected in the vast majority of cases.
128+ But in containers syncing the local clock is usually impossible, but this
129+ shall not break the providing of NTP services to the network.
130+ To some extent this makes chrony's default config more similar to 'ntpd',
131+ which complained in syslog but still provided NTP server service in those
132+ cases.
133+ + debian/chrony.service: allow the service to run without CAP_SYS_TIME
134+ + debian/control: add new dependency libcap2-bin for capsh (usually
135+ installed anyway, but make them explicit to be sure).
136+ + debian/chrony.default: new option SYNC_IN_CONTAINER to not fall back
137+ (Default off) [fixed a minor typo in the comment in this update]
138+ + debian/chronyd-starter.sh: wrapper to handle special cases in containers
139+ and if CAP_SYS_TIME is missing. Effectively allows to run NTP server in
140+ containers on a default installation and avoid failing to sync time (or
141+ if allowed to sync, avoid multiple containers to fight over it by
142+ accident).
143+ + debian/install: make chrony-starter.sh available on install.
144+ + debian/docs, debian/README.container: provide documentation about the
145+ handling of this case.
146+ - d/postrm: re-establish systemd-timesyncd on removal (LP 1764357)
147+ - d/postrm: respect policy-rc.d when restoring systemd-timesyncd
148+ (LP 1771994)
149+ * Added Changes:
150+ - removed d/init to avoid weird interactions between sysV and systemd
151+ * Dropped Changes:
152+ - Notify chrony to update sources in response to systemd-networkd
153+ events (LP: 1718227)
154+ + d/links: link dispatcher script to networkd-dispatcher events routable
155+ and off
156+ + d/control: set Recommends to networkd-dispatcher
157+ [Those are in Debian, except that we agreed to have networkd-dispatcher
158+ to only be a Suggests]
159+
160+ -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Tue, 14 May 2019 12:49:30 +0200
161+
162 chrony (3.4-4) unstable; urgency=medium
163
164 * debian/patches/*:
165@@ -160,6 +243,48 @@ chrony (3.4-2) unstable; urgency=medium
166
167 -- Vincent Blut <vincent.debian@free.fr> Wed, 13 Feb 2019 17:08:17 +0100
168
169+chrony (3.4-1ubuntu1) disco; urgency=medium
170+
171+ * Merge with Debian unstable (LP: #1802886). Remaining changes:
172+ - d/chrony.conf: use ubuntu ntp pool and server (LP 1744664)
173+ - Set -x as default if unable to set time (e.g. in containers) (LP: 1589780)
174+ Chrony is a single service which acts as both NTP client (i.e. syncing the
175+ local clock) and NTP server (i.e. providing NTP services to the network),
176+ and that is both desired and expected in the vast majority of cases.
177+ But in containers syncing the local clock is usually impossible, but this
178+ shall not break the providing of NTP services to the network.
179+ To some extent this makes chrony's default config more similar to 'ntpd',
180+ which complained in syslog but still provided NTP server service in those
181+ cases.
182+ + debian/chrony.service: allow the service to run without CAP_SYS_TIME
183+ + debian/control: add new dependency libcap2-bin for capsh (usually
184+ installed anyway, but make them explicit to be sure).
185+ + debian/chrony.default: new option SYNC_IN_CONTAINER to not fall back
186+ (Default off).
187+ + debian/chronyd-starter.sh: wrapper to handle special cases in containers
188+ and if CAP_SYS_TIME is missing. Effectively allows to run NTP server in
189+ containers on a default installation and avoid failing to sync time (or
190+ if allowed to sync, avoid multiple containers to fight over it by
191+ accident).
192+ + debian/install: make chronyd-starter.sh available on install.
193+ + debian/docs, debian/README.container: provide documentation about the
194+ handling of this case.
195+ - d/postrm: re-establish systemd-timesyncd on removal (LP: 1764357)
196+ - Notify chrony to update sources in response to systemd-networkd
197+ events (LP: 1718227)
198+ + d/links: link dispatcher script to networkd-dispatcher events routable
199+ and off
200+ + d/control: set Recommends to networkd-dispatcher
201+ * Dropped Changes (upstream):
202+ - d/p/lp-1718227-nm-dispatcher-for-networkd.patch
203+ - d/p/lp-1787366-fall-back-to-urandom.patch: avoid hangs when starting
204+ the service on newer kernels by falling back to urandom. (LP: 1787366)
205+ * Added Changes:
206+ - d/postrm: respect policy-rc.d when restoring systemd-timesyncd
207+ (LP: #1771994)
208+
209+ -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Mon, 12 Nov 2018 11:39:08 +0100
210+
211 chrony (3.4-1) unstable; urgency=medium
212
213 * Import upstream version 3.4:
214@@ -236,6 +361,66 @@ chrony (3.3-3) unstable; urgency=medium
215
216 -- Vincent Blut <vincent.debian@free.fr> Sat, 18 Aug 2018 16:23:19 +0200
217
218+chrony (3.3-2ubuntu2) cosmic; urgency=medium
219+
220+ * - d/p/lp-1787366-fall-back-to-urandom.patch: avoid hangs when starting
221+ the service on newer kernels by falling back to urandom.
222+ (LP: #1787366, Closes: #906276)
223+
224+ -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Thu, 16 Aug 2018 11:48:38 +0200
225+
226+chrony (3.3-2ubuntu1) cosmic; urgency=medium
227+
228+ * Merge with Debian unstable (LP: #1771061). Remaining changes:
229+ - d/chrony.conf: use ubuntu ntp pool and server (LP 1744664)
230+ - Set -x as default if unable to set time (e.g. in containers) (LP: 1589780)
231+ Chrony is a single service which acts as both NTP client (i.e. syncing the
232+ local clock) and NTP server (i.e. providing NTP services to the network),
233+ and that is both desired and expected in the vast majority of cases.
234+ But in containers syncing the local clock is usually impossible, but this
235+ shall not break the providing of NTP services to the network.
236+ To some extent this makes chrony's default config more similar to 'ntpd',
237+ which complained in syslog but still provided NTP server service in those
238+ cases.
239+ - debian/chrony.service: allow the service to run without CAP_SYS_TIME
240+ - debian/control: add new dependency libcap2-bin for capsh (usually
241+ installed anyway, but make them explicit to be sure).
242+ - debian/chrony.default: new option SYNC_IN_CONTAINER to not fall back
243+ (Default off).
244+ - debian/chronyd-starter.sh: wrapper to handle special cases in containers
245+ and if CAP_SYS_TIME is missing. Effectively allows to run NTP server in
246+ containers on a default installation and avoid failing to sync time (or
247+ if allowed to sync, avoid multiple containers to fight over it by
248+ accident).
249+ - debian/install: make chronyd-starter.sh available on install.
250+ - debian/docs, debian/README.container: provide documentation about the
251+ handling of this case.
252+ - d/postrm: re-establish systemd-timesyncd on removal (LP: 1764357)
253+ - Notify chrony to update sources in response to systemd-networkd
254+ events (LP: 1718227)
255+ - d/links: link dispatcher script to networkd-dispatcher events routable
256+ and off
257+ - d/control: set Recommends to networkd-dispatcher
258+ - d/p/lp-1718227-nm-dispatcher-for-networkd.patch
259+ * Dropped changes
260+ - debian/usr.sbin.chronyd: ensure RTC/GPS usage isn't blocked by apparmor
261+ (LP: 1751241) (in Debian now)
262+ - debian/usr.sbin.chronyd: add cap net_admin for hwtimestamp (LP: 1761327)
263+ (in Debian now)
264+ - d/p/lp1589780-sys_linux-don-t-keep-CAP_SYS_TIME-with-x-option.patch:
265+ When dropping the root privileges, don't try to keep the CAP_SYS_TIME
266+ capability if the -x option was enabled. This allows chronyd to be
267+ started without the capability (e.g. in containers) and also drop the
268+ root privileges (This is upstream now).
269+ - d/p/lp-1718227-ignore-non-up-down-events-in-nm-dispatcher.patch (This is
270+ upstream now).
271+ - d/control: switch to nss instead of tomcrypt (Debian switched to nettle
272+ which is in main, so we can drop this)
273+ * Added changes
274+ - debian/README.container: fix typos
275+
276+ -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Mon, 14 May 2018 09:06:01 +0200
277+
278 chrony (3.3-2) unstable; urgency=medium
279
280 * debian/chrony.service:
281@@ -291,6 +476,76 @@ chrony (3.2-5) unstable; urgency=medium
282
283 -- Vincent Blut <vincent.debian@free.fr> Wed, 28 Feb 2018 17:31:08 +0100
284
285+chrony (3.2-4ubuntu4) bionic; urgency=medium
286+
287+ * d/postrm: re-establish systemd-timesyncd on removal (LP: #1764357)
288+ * Notify chrony to update sources in response to systemd-networkd
289+ events (LP: #1718227)
290+ - d/links: link dispatcher script to networkd-dispatcher events routable
291+ and off
292+ - d/control: set Recommends to networkd-dispatcher
293+ - d/p/lp-1718227-ignore-non-up-down-events-in-nm-dispatcher.patch
294+ - d/p/lp-1718227-nm-dispatcher-for-networkd.patch
295+
296+ -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Mon, 16 Apr 2018 17:04:06 +0200
297+
298+chrony (3.2-4ubuntu3) bionic; urgency=medium
299+
300+ * debian/usr.sbin.chronyd: add cap net_admin for hwtimestamp (LP: #1761327)
301+
302+ -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Thu, 05 Apr 2018 09:38:10 +0200
303+
304+chrony (3.2-4ubuntu2) bionic; urgency=medium
305+
306+ * Set -x as default if unable to set time (e.g. in containers) (LP: #1589780)
307+ Chrony is a single service which acts as both NTP client (i.e. syncing the
308+ local clock) and NTP server (i.e. providing NTP services to the network),
309+ and that is both desired and expected in the vast majority of cases.
310+ But in containers syncing the local clock is usually impossible, but this
311+ shall not break the providing of NTP services to the network.
312+ To some extent this makes chrony's default config more similar to 'ntpd',
313+ which complained in syslog but still provided NTP server service in those
314+ cases.
315+ - d/p/lp1589780-sys_linux-don-t-keep-CAP_SYS_TIME-with-x-option.patch:
316+ When dropping the root privileges, don't try to keep the CAP_SYS_TIME
317+ capability if the -x option was enabled. This allows chronyd to be
318+ started without the capability (e.g. in containers) and also drop the
319+ root privileges.
320+ - debian/chrony.service: allow the service to run without CAP_SYS_TIME
321+ - debian/control: add new dependency libcap2-bin for capsh (usually
322+ installed anyway, but make them explicit to be sure).
323+ - debian/chrony.default: new option SYNC_IN_CONTAINER to not fall back
324+ (Default off).
325+ - debian/chronyd-starter.sh: wrapper to handle special cases in containers
326+ and if CAP_SYS_TIME is missing. Effectively allows to run NTP server in
327+ containers on a default installation and avoid failing to sync time (or
328+ if allowed to sync, avoid multiple containers to fight over it by
329+ accident).
330+ - debian/install: make chronyd-starter.sh available on install.
331+ - debian/docs, debian/README.container: provide documentation about the
332+ handling of this case.
333+ * debian/chrony.conf: update default chrony.conf to not violate the policy
334+ of pool.ntp.org (to use no more than four of their servers) and to provide
335+ more ipv6 capable sources by default (LP: #1754358)
336+
337+ -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Fri, 16 Mar 2018 12:25:44 +0100
338+
339+chrony (3.2-4ubuntu1) bionic; urgency=medium
340+
341+ * Merge with Debian unstable. Remaining changes:
342+ - d/control: switch to nss instead of tomcrypt (nss is in main)
343+ - d/chrony.conf: use ubuntu ntp pool and server (LP 1744664)
344+ * Dropped changes (in Debian)
345+ - d/chrony.default, d/chrony.service: support /etc/default/chrony
346+ DAEMON_OPTS in systemd environment (LP: 1746081)
347+ - d/chrony.service: properly start after networking (LP: 1746458)
348+ - d/usr.sbin.chronyd: allow to create /run/chrony on demand (LP: 1746444)
349+ * Added Changes:
350+ - debian/usr.sbin.chronyd: ensure RTC/GPS usage isn't blocked by apparmor
351+ (LP: #1751241, Closes: #891201)
352+
353+ -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Mon, 26 Feb 2018 14:44:54 +0100
354+
355 chrony (3.2-4) unstable; urgency=medium
356
357 * debian/changelog:
358@@ -357,6 +612,27 @@ chrony (3.2-3) unstable; urgency=medium
359
360 -- Vincent Blut <vincent.debian@free.fr> Wed, 07 Feb 2018 21:27:09 +0100
361
362+chrony (3.2-2ubuntu3) bionic; urgency=medium
363+
364+ * Revert the changes of (LP 1746458) as in the follow on discussion
365+ it became clear that we want it to start early (for example for an
366+ early offset from drift file). iIf needed chrony will later on pick
367+ up that servers are online via retries (augmented by hooks on network
368+ events).
369+
370+ -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Thu, 08 Feb 2018 10:52:30 +0100
371+
372+chrony (3.2-2ubuntu2) bionic; urgency=medium
373+
374+ * d/control: use to nss instead of tomcrypt (in main) (LP: #1744072)
375+ * d/chrony.conf: use ubuntu ntp pool and server (LP: #1744664)
376+ * d/chrony.default, d/chrony.service: support /etc/default/chrony
377+ DAEMON_OPTS in systemd environment (LP: #1746081)
378+ * d/chrony.service: properly start after networking (LP: #1746458)
379+ * d/usr.sbin.chronyd: allow to create /run/chrony on demand (LP: #1746444)
380+
381+ -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Fri, 19 Jan 2018 09:45:38 +0100
382+
383 chrony (3.2-2) unstable; urgency=medium
384
385 * Initial AppArmor profile for chronyd. Thanks to Jamie
386diff --git a/debian/chrony.conf b/debian/chrony.conf
387index 6c19767..d5a0b37 100644
388--- a/debian/chrony.conf
389+++ b/debian/chrony.conf
390@@ -1,6 +1,23 @@
391 # Welcome to the chrony configuration file. See chrony.conf(5) for more
392 # information about usuable directives.
393-pool 2.debian.pool.ntp.org iburst
394+
395+# This will use (up to):
396+# - 4 sources from ntp.ubuntu.com which some are ipv6 enabled
397+# - 2 sources from 2.ubuntu.pool.ntp.org which is ipv6 enabled as well
398+# - 1 source from [01].ubuntu.pool.ntp.org each (ipv4 only atm)
399+# This means by default, up to 6 dual-stack and up to 2 additional IPv4-only
400+# sources will be used.
401+# At the same time it retains some protection against one of the entries being
402+# down (compare to just using one of the lines). See (LP: #1754358) for the
403+# discussion.
404+#
405+# About using servers from the NTP Pool Project in general see (LP: #104525).
406+# Approved by Ubuntu Technical Board on 2011-02-08.
407+# See http://www.pool.ntp.org/join.html for more information.
408+pool ntp.ubuntu.com iburst maxsources 4
409+pool 0.ubuntu.pool.ntp.org iburst maxsources 1
410+pool 1.ubuntu.pool.ntp.org iburst maxsources 1
411+pool 2.ubuntu.pool.ntp.org iburst maxsources 2
412
413 # This directive specify the location of the file containing ID/key pairs for
414 # NTP authentication.
415diff --git a/debian/chrony.default b/debian/chrony.default
416index eead3e6..5391fc4 100644
417--- a/debian/chrony.default
418+++ b/debian/chrony.default
419@@ -4,3 +4,7 @@
420
421 # Options to pass to chrony.
422 DAEMON_OPTS="-F -1"
423+
424+# Sync system clock in containers or without CAP_SYS_TIME (likely to fail)
425+# See /usr/share/doc/chrony/README.container for details.
426+SYNC_IN_CONTAINER="no"
427diff --git a/debian/chrony.service b/debian/chrony.service
428index 3e4451a..bb01a79 100644
429--- a/debian/chrony.service
430+++ b/debian/chrony.service
431@@ -3,13 +3,13 @@ Description=chrony, an NTP client/server
432 Documentation=man:chronyd(8) man:chronyc(1) man:chrony.conf(5)
433 Conflicts=systemd-timesyncd.service openntpd.service ntp.service ntpsec.service
434 After=network.target
435-ConditionCapability=CAP_SYS_TIME
436
437 [Service]
438 Type=forking
439 PIDFile=/run/chronyd.pid
440 EnvironmentFile=-/etc/default/chrony
441-ExecStart=/usr/sbin/chronyd $DAEMON_OPTS
442+# Starter takes care of special cases mostly for containers
443+ExecStart=/usr/lib/systemd/scripts/chronyd-starter.sh $DAEMON_OPTS
444 ExecStartPost=-/usr/lib/chrony/chrony-helper update-daemon
445 PrivateTmp=yes
446 ProtectHome=yes
447diff --git a/debian/chronyd-starter.sh b/debian/chronyd-starter.sh
448new file mode 100755
449index 0000000..c175db5
450--- /dev/null
451+++ b/debian/chronyd-starter.sh
452@@ -0,0 +1,70 @@
453+#!/bin/sh
454+set -ue
455+
456+CONF="/etc/default/chrony"
457+DOC="/usr/share/doc/chrony/README.container"
458+CAP="cap_sys_time"
459+CMD="/usr/sbin/chronyd"
460+# Take any args passed, use none if nothing was specified
461+EFFECTIVE_DAEMON_OPTS=${@:-""}
462+
463+if [ -f "${CONF}" ]; then
464+ . "${CONF}"
465+else
466+ echo "<4>Warning: ${CONF} is missing"
467+fi
468+# take from conffile if available, default to no otherwise
469+EFFECTIVE_SYNC_IN_CONTAINER=${SYNC_IN_CONTAINER:-"no"}
470+
471+if [ ! -x "${CMD}" ]; then
472+ echo "<3>Error: ${CMD} not executable"
473+ # ugly, but works around https://github.com/systemd/systemd/issues/2913
474+ sleep 0.1
475+ exit 1
476+fi
477+
478+# Check if -x is already set manually, don't process further if that is the case
479+X_SET=0
480+while getopts ":x" opt; do
481+ case $opt in
482+ x)
483+ X_SET=1
484+ ;;
485+ esac
486+done
487+
488+if [ ${X_SET} -ne 1 ]; then
489+ # Assume it is not in a container
490+ IS_CONTAINER=0
491+ if [ -x /usr/bin/systemd-detect-virt ]; then
492+ if /usr/bin/systemd-detect-virt --quiet --container; then
493+ IS_CONTAINER=1
494+ fi
495+ fi
496+
497+
498+ # Assume it has the cap
499+ HAS_CAP=1
500+ CAPSH="/sbin/capsh"
501+ if [ -x "${CAPSH}" ]; then
502+ ${CAPSH} --print | grep -q "^Current.*${CAP}" || HAS_CAP=0
503+ fi
504+
505+ if [ ${HAS_CAP} -eq 0 ]; then
506+ echo "<4>Warning: Missing ${CAP}, syncing the system clock will fail"
507+ fi
508+ if [ ${IS_CONTAINER} -eq 1 ]; then
509+ echo "<4>Warning: Running in a container, likely impossible and unintended to sync system clock"
510+ fi
511+
512+ if [ ${HAS_CAP} -eq 0 -o ${IS_CONTAINER} -eq 1 ]; then
513+ if [ "${EFFECTIVE_SYNC_IN_CONTAINER}" != "yes" ]; then
514+ echo "<5>Adding -x as fallback disabling control of the system clock, see ${DOC} to override this behavior"
515+ EFFECTIVE_DAEMON_OPTS="${EFFECTIVE_DAEMON_OPTS} -x"
516+ else
517+ echo "<5>Not falling back to disable control of the system clock, see ${DOC} to change this behavior"
518+ fi
519+ fi
520+fi
521+
522+${CMD} ${EFFECTIVE_DAEMON_OPTS}
523diff --git a/debian/control b/debian/control
524index 0da2ecf..197ae0c 100644
525--- a/debian/control
526+++ b/debian/control
527@@ -1,7 +1,8 @@
528 Source: chrony
529 Section: net
530 Priority: optional
531-Maintainer: Vincent Blut <vincent.debian@free.fr>
532+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
533+XSBC-Original-Maintainer: Vincent Blut <vincent.debian@free.fr>
534 Uploaders: Joachim Wiedorn <joodebian@joonet.de>
535 Standards-Version: 4.3.0
536 Build-Depends: asciidoctor (>= 1.5.3-1~),
537@@ -26,6 +27,7 @@ Architecture: linux-any
538 Pre-Depends: ${misc:Pre-Depends}
539 Depends: adduser,
540 iproute2 [linux-any],
541+ libcap2-bin,
542 ucf,
543 ${misc:Depends},
544 ${shlibs:Depends}
545diff --git a/debian/docs b/debian/docs
546index e12f653..3bfc9dc 100644
547--- a/debian/docs
548+++ b/debian/docs
549@@ -1,3 +1,4 @@
550 FAQ
551 NEWS
552 README
553+debian/README.container
554diff --git a/debian/install b/debian/install
555index db2e305..abaa2f3 100644
556--- a/debian/install
557+++ b/debian/install
558@@ -2,3 +2,4 @@ debian/chrony-dnssrv@.* lib/systemd/system
559 debian/chrony-helper usr/lib/chrony
560 debian/chrony.conf usr/share/chrony
561 debian/usr.sbin.chronyd etc/apparmor.d
562+debian/chronyd-starter.sh usr/lib/systemd/scripts/

Subscribers

People subscribed via source and target branches