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
diff --git a/debian/README.container b/debian/README.container
0new file mode 1006440new file mode 100644
index 0000000..16f2618
--- /dev/null
+++ b/debian/README.container
@@ -0,0 +1,60 @@
1Chrony in Containers
2--------------------
3
4Currently in in 99.9+% of the cases syncing the local clock in a container
5is wrong. Most of the time it will be unable to do so, because it is lacking
6CAP_SYS_TIME. Or worse, if the CAP_SYS_TIME privilege is granted, multiple
7containers could fight over the system's time, because the Linux kernel does
8not provide time namespaces (yet).
9
10There are two things a user installing chrony usually wants:
111. synchronize my time (NTP client)
122. serve NTP (NTP server)
13
14In a container the first makes (usually) no sense, so by default we enable -x
15there (as it would only crash otherwise).
16This will disable the control of the system clock.
17See `man chronyd` for more details on the -x option.
18
19Formerly, the check for Condition=CAP_SYS_TIME in the systemd service avoided
20the crash of the NTP client portion, but that means the server use case will
21not work by default in containers. It is still not recommended to use a
22container as an NTP server, but if the host clock is synchronised via NTP,
23adding the -x option to chronyd instances running in containers will allow
24them to function as NTP servers which do not adjust the system clock.
25The Condition=CAP_SYS_TIME check was a silent, no-log-entry stealing away
26leaving users often unclear what happened - especially if they were more after
27the NTP server than the NTP client.
28
29One could argue that someone who installs chrony expects the system time to be
30synchronised, so it should fail if it is not able to do so. On the other hand
31it could be argued that someone who installs chrony expects time to be served
32over the network via NTP.
33We can't know which expectation is applicable, so we assume that time should
34be synchronised unless chronyd is running in a container (or is without
35CAP_SYS_TIME in any other environment).
36
37To make things worse recent container implementations will offer CAP_SYS_TIME
38to the container. Since from the container's point of view, this capability is
39available for the container's user namespace. Just later on adjtimex and similar
40are actually evaluated against the host kernel where they will fail. Due to
41that without further precaution running chrony in Ubuntu in the future will
42likely have the service start (as Condition=CAP_SYS_TIME will be true) but
43then immediately fail.
44This will depend on the environment e.g. versions and types of containers and
45thereby feel just 'unreliable' from users point of view.
46Furthermore it will affect upgrades as the service has to be restarted for a
47package upgrade to be considered complete.
48
49Due to all of that Ubuntu decided (LP: #1589780) to default to -x (do not
50set the system clock) in containers.
51
52If one really wants to (try to) sync time in a container or CAP_SYS_TIME-less
53environment set SYNC_IN_CONTAINER="yes" in /etc/default/chrony to disable
54this special handling.
55
56It is important to mention that as soon as upstream provides a way to provide
57a default config working in those cases Ubuntu intends to use that and drop
58the current workaround.
59
60 -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Fri, 16 Mar 2018 12:25:44 +0100
diff --git a/debian/changelog b/debian/changelog
index f3c52fc..8177c32 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,36 @@
1chrony (3.5-2ubuntu1) eoan; urgency=medium
2
3 * Merge with Debian experimental (LP: #1835046). Remaining changes:
4 - d/chrony.conf: use ubuntu ntp pool and server (LP 1744664 1754358)
5 - Set -x as default if unable to set time (e.g. in containers) (LP 1589780)
6 Chrony is a single service which acts as both NTP client (i.e. syncing the
7 local clock) and NTP server (i.e. providing NTP services to the network),
8 and that is both desired and expected in the vast majority of cases.
9 But in containers syncing the local clock is usually impossible, but this
10 shall not break the providing of NTP services to the network.
11 To some extent this makes chrony's default config more similar to 'ntpd',
12 which complained in syslog but still provided NTP server service in those
13 cases.
14 + debian/chrony.service: allow the service to run without CAP_SYS_TIME
15 + debian/control: add new dependency libcap2-bin for capsh (usually
16 installed anyway, but make them explicit to be sure).
17 + debian/chrony.default: new option SYNC_IN_CONTAINER to not fall back
18 (Default off) [fixed a minor typo in the comment in this update]
19 + debian/chronyd-starter.sh: wrapper to handle special cases in containers
20 and if CAP_SYS_TIME is missing. Effectively allows to run NTP server in
21 containers on a default installation and avoid failing to sync time (or
22 if allowed to sync, avoid multiple containers to fight over it by
23 accident).
24 + debian/install: make chrony-starter.sh available on install.
25 + debian/docs, debian/README.container: provide documentation about the
26 handling of this case.
27 * Dropped changes (accepted in Debian now):
28 - d/postrm: re-establish systemd-timesyncd on removal (LP 1764357)
29 - d/postrm: respect policy-rc.d when restoring systemd-timesyncd
30 (LP 1771994)
31
32 -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Tue, 02 Jul 2019 13:37:23 +0200
33
1chrony (3.5-2) unstable; urgency=medium34chrony (3.5-2) unstable; urgency=medium
235
3 * Merge branch “experimental” into “master”.36 * Merge branch “experimental” into “master”.
@@ -84,6 +117,56 @@ chrony (3.5~pre1-1) experimental; urgency=medium
84117
85 -- Vincent Blut <vincent.debian@free.fr> Sun, 12 May 2019 22:16:14 +0200118 -- Vincent Blut <vincent.debian@free.fr> Sun, 12 May 2019 22:16:14 +0200
86119
120chrony (3.4-4ubuntu2) eoan; urgency=medium
121
122 * Dropped sysV change added in 3.4-4ubuntu1 (LP: #1829700):
123 - removed d/init to avoid weird interactions between sysV and systemd
124 [With debhelper compat level 12 this isn't an issue anymore]
125
126 -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Wed, 22 May 2019 09:10:41 +0200
127
128chrony (3.4-4ubuntu1) eoan; urgency=medium
129
130 * Merge with Debian unstable (LP: #1828992). Remaining changes:
131 - d/chrony.conf: use ubuntu ntp pool and server (LP 1744664 1754358)
132 - Set -x as default if unable to set time (e.g. in containers) (LP 1589780)
133 Chrony is a single service which acts as both NTP client (i.e. syncing the
134 local clock) and NTP server (i.e. providing NTP services to the network),
135 and that is both desired and expected in the vast majority of cases.
136 But in containers syncing the local clock is usually impossible, but this
137 shall not break the providing of NTP services to the network.
138 To some extent this makes chrony's default config more similar to 'ntpd',
139 which complained in syslog but still provided NTP server service in those
140 cases.
141 + debian/chrony.service: allow the service to run without CAP_SYS_TIME
142 + debian/control: add new dependency libcap2-bin for capsh (usually
143 installed anyway, but make them explicit to be sure).
144 + debian/chrony.default: new option SYNC_IN_CONTAINER to not fall back
145 (Default off) [fixed a minor typo in the comment in this update]
146 + debian/chronyd-starter.sh: wrapper to handle special cases in containers
147 and if CAP_SYS_TIME is missing. Effectively allows to run NTP server in
148 containers on a default installation and avoid failing to sync time (or
149 if allowed to sync, avoid multiple containers to fight over it by
150 accident).
151 + debian/install: make chrony-starter.sh available on install.
152 + debian/docs, debian/README.container: provide documentation about the
153 handling of this case.
154 - d/postrm: re-establish systemd-timesyncd on removal (LP 1764357)
155 - d/postrm: respect policy-rc.d when restoring systemd-timesyncd
156 (LP 1771994)
157 * Added Changes:
158 - removed d/init to avoid weird interactions between sysV and systemd
159 * Dropped Changes:
160 - Notify chrony to update sources in response to systemd-networkd
161 events (LP: 1718227)
162 + d/links: link dispatcher script to networkd-dispatcher events routable
163 and off
164 + d/control: set Recommends to networkd-dispatcher
165 [Those are in Debian, except that we agreed to have networkd-dispatcher
166 to only be a Suggests]
167
168 -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Tue, 14 May 2019 12:49:30 +0200
169
87chrony (3.4-4) unstable; urgency=medium170chrony (3.4-4) unstable; urgency=medium
88171
89 * debian/patches/*:172 * debian/patches/*:
@@ -160,6 +243,48 @@ chrony (3.4-2) unstable; urgency=medium
160243
161 -- Vincent Blut <vincent.debian@free.fr> Wed, 13 Feb 2019 17:08:17 +0100244 -- Vincent Blut <vincent.debian@free.fr> Wed, 13 Feb 2019 17:08:17 +0100
162245
246chrony (3.4-1ubuntu1) disco; urgency=medium
247
248 * Merge with Debian unstable (LP: #1802886). Remaining changes:
249 - d/chrony.conf: use ubuntu ntp pool and server (LP 1744664)
250 - Set -x as default if unable to set time (e.g. in containers) (LP: 1589780)
251 Chrony is a single service which acts as both NTP client (i.e. syncing the
252 local clock) and NTP server (i.e. providing NTP services to the network),
253 and that is both desired and expected in the vast majority of cases.
254 But in containers syncing the local clock is usually impossible, but this
255 shall not break the providing of NTP services to the network.
256 To some extent this makes chrony's default config more similar to 'ntpd',
257 which complained in syslog but still provided NTP server service in those
258 cases.
259 + debian/chrony.service: allow the service to run without CAP_SYS_TIME
260 + debian/control: add new dependency libcap2-bin for capsh (usually
261 installed anyway, but make them explicit to be sure).
262 + debian/chrony.default: new option SYNC_IN_CONTAINER to not fall back
263 (Default off).
264 + debian/chronyd-starter.sh: wrapper to handle special cases in containers
265 and if CAP_SYS_TIME is missing. Effectively allows to run NTP server in
266 containers on a default installation and avoid failing to sync time (or
267 if allowed to sync, avoid multiple containers to fight over it by
268 accident).
269 + debian/install: make chronyd-starter.sh available on install.
270 + debian/docs, debian/README.container: provide documentation about the
271 handling of this case.
272 - d/postrm: re-establish systemd-timesyncd on removal (LP: 1764357)
273 - Notify chrony to update sources in response to systemd-networkd
274 events (LP: 1718227)
275 + d/links: link dispatcher script to networkd-dispatcher events routable
276 and off
277 + d/control: set Recommends to networkd-dispatcher
278 * Dropped Changes (upstream):
279 - d/p/lp-1718227-nm-dispatcher-for-networkd.patch
280 - d/p/lp-1787366-fall-back-to-urandom.patch: avoid hangs when starting
281 the service on newer kernels by falling back to urandom. (LP: 1787366)
282 * Added Changes:
283 - d/postrm: respect policy-rc.d when restoring systemd-timesyncd
284 (LP: #1771994)
285
286 -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Mon, 12 Nov 2018 11:39:08 +0100
287
163chrony (3.4-1) unstable; urgency=medium288chrony (3.4-1) unstable; urgency=medium
164289
165 * Import upstream version 3.4:290 * Import upstream version 3.4:
@@ -236,6 +361,66 @@ chrony (3.3-3) unstable; urgency=medium
236361
237 -- Vincent Blut <vincent.debian@free.fr> Sat, 18 Aug 2018 16:23:19 +0200362 -- Vincent Blut <vincent.debian@free.fr> Sat, 18 Aug 2018 16:23:19 +0200
238363
364chrony (3.3-2ubuntu2) cosmic; urgency=medium
365
366 * - d/p/lp-1787366-fall-back-to-urandom.patch: avoid hangs when starting
367 the service on newer kernels by falling back to urandom.
368 (LP: #1787366, Closes: #906276)
369
370 -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Thu, 16 Aug 2018 11:48:38 +0200
371
372chrony (3.3-2ubuntu1) cosmic; urgency=medium
373
374 * Merge with Debian unstable (LP: #1771061). Remaining changes:
375 - d/chrony.conf: use ubuntu ntp pool and server (LP 1744664)
376 - Set -x as default if unable to set time (e.g. in containers) (LP: 1589780)
377 Chrony is a single service which acts as both NTP client (i.e. syncing the
378 local clock) and NTP server (i.e. providing NTP services to the network),
379 and that is both desired and expected in the vast majority of cases.
380 But in containers syncing the local clock is usually impossible, but this
381 shall not break the providing of NTP services to the network.
382 To some extent this makes chrony's default config more similar to 'ntpd',
383 which complained in syslog but still provided NTP server service in those
384 cases.
385 - debian/chrony.service: allow the service to run without CAP_SYS_TIME
386 - debian/control: add new dependency libcap2-bin for capsh (usually
387 installed anyway, but make them explicit to be sure).
388 - debian/chrony.default: new option SYNC_IN_CONTAINER to not fall back
389 (Default off).
390 - debian/chronyd-starter.sh: wrapper to handle special cases in containers
391 and if CAP_SYS_TIME is missing. Effectively allows to run NTP server in
392 containers on a default installation and avoid failing to sync time (or
393 if allowed to sync, avoid multiple containers to fight over it by
394 accident).
395 - debian/install: make chronyd-starter.sh available on install.
396 - debian/docs, debian/README.container: provide documentation about the
397 handling of this case.
398 - d/postrm: re-establish systemd-timesyncd on removal (LP: 1764357)
399 - Notify chrony to update sources in response to systemd-networkd
400 events (LP: 1718227)
401 - d/links: link dispatcher script to networkd-dispatcher events routable
402 and off
403 - d/control: set Recommends to networkd-dispatcher
404 - d/p/lp-1718227-nm-dispatcher-for-networkd.patch
405 * Dropped changes
406 - debian/usr.sbin.chronyd: ensure RTC/GPS usage isn't blocked by apparmor
407 (LP: 1751241) (in Debian now)
408 - debian/usr.sbin.chronyd: add cap net_admin for hwtimestamp (LP: 1761327)
409 (in Debian now)
410 - d/p/lp1589780-sys_linux-don-t-keep-CAP_SYS_TIME-with-x-option.patch:
411 When dropping the root privileges, don't try to keep the CAP_SYS_TIME
412 capability if the -x option was enabled. This allows chronyd to be
413 started without the capability (e.g. in containers) and also drop the
414 root privileges (This is upstream now).
415 - d/p/lp-1718227-ignore-non-up-down-events-in-nm-dispatcher.patch (This is
416 upstream now).
417 - d/control: switch to nss instead of tomcrypt (Debian switched to nettle
418 which is in main, so we can drop this)
419 * Added changes
420 - debian/README.container: fix typos
421
422 -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Mon, 14 May 2018 09:06:01 +0200
423
239chrony (3.3-2) unstable; urgency=medium424chrony (3.3-2) unstable; urgency=medium
240425
241 * debian/chrony.service:426 * debian/chrony.service:
@@ -291,6 +476,76 @@ chrony (3.2-5) unstable; urgency=medium
291476
292 -- Vincent Blut <vincent.debian@free.fr> Wed, 28 Feb 2018 17:31:08 +0100477 -- Vincent Blut <vincent.debian@free.fr> Wed, 28 Feb 2018 17:31:08 +0100
293478
479chrony (3.2-4ubuntu4) bionic; urgency=medium
480
481 * d/postrm: re-establish systemd-timesyncd on removal (LP: #1764357)
482 * Notify chrony to update sources in response to systemd-networkd
483 events (LP: #1718227)
484 - d/links: link dispatcher script to networkd-dispatcher events routable
485 and off
486 - d/control: set Recommends to networkd-dispatcher
487 - d/p/lp-1718227-ignore-non-up-down-events-in-nm-dispatcher.patch
488 - d/p/lp-1718227-nm-dispatcher-for-networkd.patch
489
490 -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Mon, 16 Apr 2018 17:04:06 +0200
491
492chrony (3.2-4ubuntu3) bionic; urgency=medium
493
494 * debian/usr.sbin.chronyd: add cap net_admin for hwtimestamp (LP: #1761327)
495
496 -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Thu, 05 Apr 2018 09:38:10 +0200
497
498chrony (3.2-4ubuntu2) bionic; urgency=medium
499
500 * Set -x as default if unable to set time (e.g. in containers) (LP: #1589780)
501 Chrony is a single service which acts as both NTP client (i.e. syncing the
502 local clock) and NTP server (i.e. providing NTP services to the network),
503 and that is both desired and expected in the vast majority of cases.
504 But in containers syncing the local clock is usually impossible, but this
505 shall not break the providing of NTP services to the network.
506 To some extent this makes chrony's default config more similar to 'ntpd',
507 which complained in syslog but still provided NTP server service in those
508 cases.
509 - d/p/lp1589780-sys_linux-don-t-keep-CAP_SYS_TIME-with-x-option.patch:
510 When dropping the root privileges, don't try to keep the CAP_SYS_TIME
511 capability if the -x option was enabled. This allows chronyd to be
512 started without the capability (e.g. in containers) and also drop the
513 root privileges.
514 - debian/chrony.service: allow the service to run without CAP_SYS_TIME
515 - debian/control: add new dependency libcap2-bin for capsh (usually
516 installed anyway, but make them explicit to be sure).
517 - debian/chrony.default: new option SYNC_IN_CONTAINER to not fall back
518 (Default off).
519 - debian/chronyd-starter.sh: wrapper to handle special cases in containers
520 and if CAP_SYS_TIME is missing. Effectively allows to run NTP server in
521 containers on a default installation and avoid failing to sync time (or
522 if allowed to sync, avoid multiple containers to fight over it by
523 accident).
524 - debian/install: make chronyd-starter.sh available on install.
525 - debian/docs, debian/README.container: provide documentation about the
526 handling of this case.
527 * debian/chrony.conf: update default chrony.conf to not violate the policy
528 of pool.ntp.org (to use no more than four of their servers) and to provide
529 more ipv6 capable sources by default (LP: #1754358)
530
531 -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Fri, 16 Mar 2018 12:25:44 +0100
532
533chrony (3.2-4ubuntu1) bionic; urgency=medium
534
535 * Merge with Debian unstable. Remaining changes:
536 - d/control: switch to nss instead of tomcrypt (nss is in main)
537 - d/chrony.conf: use ubuntu ntp pool and server (LP 1744664)
538 * Dropped changes (in Debian)
539 - d/chrony.default, d/chrony.service: support /etc/default/chrony
540 DAEMON_OPTS in systemd environment (LP: 1746081)
541 - d/chrony.service: properly start after networking (LP: 1746458)
542 - d/usr.sbin.chronyd: allow to create /run/chrony on demand (LP: 1746444)
543 * Added Changes:
544 - debian/usr.sbin.chronyd: ensure RTC/GPS usage isn't blocked by apparmor
545 (LP: #1751241, Closes: #891201)
546
547 -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Mon, 26 Feb 2018 14:44:54 +0100
548
294chrony (3.2-4) unstable; urgency=medium549chrony (3.2-4) unstable; urgency=medium
295550
296 * debian/changelog:551 * debian/changelog:
@@ -357,6 +612,27 @@ chrony (3.2-3) unstable; urgency=medium
357612
358 -- Vincent Blut <vincent.debian@free.fr> Wed, 07 Feb 2018 21:27:09 +0100613 -- Vincent Blut <vincent.debian@free.fr> Wed, 07 Feb 2018 21:27:09 +0100
359614
615chrony (3.2-2ubuntu3) bionic; urgency=medium
616
617 * Revert the changes of (LP 1746458) as in the follow on discussion
618 it became clear that we want it to start early (for example for an
619 early offset from drift file). iIf needed chrony will later on pick
620 up that servers are online via retries (augmented by hooks on network
621 events).
622
623 -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Thu, 08 Feb 2018 10:52:30 +0100
624
625chrony (3.2-2ubuntu2) bionic; urgency=medium
626
627 * d/control: use to nss instead of tomcrypt (in main) (LP: #1744072)
628 * d/chrony.conf: use ubuntu ntp pool and server (LP: #1744664)
629 * d/chrony.default, d/chrony.service: support /etc/default/chrony
630 DAEMON_OPTS in systemd environment (LP: #1746081)
631 * d/chrony.service: properly start after networking (LP: #1746458)
632 * d/usr.sbin.chronyd: allow to create /run/chrony on demand (LP: #1746444)
633
634 -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Fri, 19 Jan 2018 09:45:38 +0100
635
360chrony (3.2-2) unstable; urgency=medium636chrony (3.2-2) unstable; urgency=medium
361637
362 * Initial AppArmor profile for chronyd. Thanks to Jamie638 * Initial AppArmor profile for chronyd. Thanks to Jamie
diff --git a/debian/chrony.conf b/debian/chrony.conf
index 6c19767..d5a0b37 100644
--- a/debian/chrony.conf
+++ b/debian/chrony.conf
@@ -1,6 +1,23 @@
1# Welcome to the chrony configuration file. See chrony.conf(5) for more1# Welcome to the chrony configuration file. See chrony.conf(5) for more
2# information about usuable directives.2# information about usuable directives.
3pool 2.debian.pool.ntp.org iburst3
4# This will use (up to):
5# - 4 sources from ntp.ubuntu.com which some are ipv6 enabled
6# - 2 sources from 2.ubuntu.pool.ntp.org which is ipv6 enabled as well
7# - 1 source from [01].ubuntu.pool.ntp.org each (ipv4 only atm)
8# This means by default, up to 6 dual-stack and up to 2 additional IPv4-only
9# sources will be used.
10# At the same time it retains some protection against one of the entries being
11# down (compare to just using one of the lines). See (LP: #1754358) for the
12# discussion.
13#
14# About using servers from the NTP Pool Project in general see (LP: #104525).
15# Approved by Ubuntu Technical Board on 2011-02-08.
16# See http://www.pool.ntp.org/join.html for more information.
17pool ntp.ubuntu.com iburst maxsources 4
18pool 0.ubuntu.pool.ntp.org iburst maxsources 1
19pool 1.ubuntu.pool.ntp.org iburst maxsources 1
20pool 2.ubuntu.pool.ntp.org iburst maxsources 2
421
5# This directive specify the location of the file containing ID/key pairs for22# This directive specify the location of the file containing ID/key pairs for
6# NTP authentication.23# NTP authentication.
diff --git a/debian/chrony.default b/debian/chrony.default
index eead3e6..5391fc4 100644
--- a/debian/chrony.default
+++ b/debian/chrony.default
@@ -4,3 +4,7 @@
44
5# Options to pass to chrony.5# Options to pass to chrony.
6DAEMON_OPTS="-F -1"6DAEMON_OPTS="-F -1"
7
8# Sync system clock in containers or without CAP_SYS_TIME (likely to fail)
9# See /usr/share/doc/chrony/README.container for details.
10SYNC_IN_CONTAINER="no"
diff --git a/debian/chrony.service b/debian/chrony.service
index 3e4451a..bb01a79 100644
--- a/debian/chrony.service
+++ b/debian/chrony.service
@@ -3,13 +3,13 @@ Description=chrony, an NTP client/server
3Documentation=man:chronyd(8) man:chronyc(1) man:chrony.conf(5)3Documentation=man:chronyd(8) man:chronyc(1) man:chrony.conf(5)
4Conflicts=systemd-timesyncd.service openntpd.service ntp.service ntpsec.service4Conflicts=systemd-timesyncd.service openntpd.service ntp.service ntpsec.service
5After=network.target5After=network.target
6ConditionCapability=CAP_SYS_TIME
76
8[Service]7[Service]
9Type=forking8Type=forking
10PIDFile=/run/chronyd.pid9PIDFile=/run/chronyd.pid
11EnvironmentFile=-/etc/default/chrony10EnvironmentFile=-/etc/default/chrony
12ExecStart=/usr/sbin/chronyd $DAEMON_OPTS11# Starter takes care of special cases mostly for containers
12ExecStart=/usr/lib/systemd/scripts/chronyd-starter.sh $DAEMON_OPTS
13ExecStartPost=-/usr/lib/chrony/chrony-helper update-daemon13ExecStartPost=-/usr/lib/chrony/chrony-helper update-daemon
14PrivateTmp=yes14PrivateTmp=yes
15ProtectHome=yes15ProtectHome=yes
diff --git a/debian/chronyd-starter.sh b/debian/chronyd-starter.sh
16new file mode 10075516new file mode 100755
index 0000000..c175db5
--- /dev/null
+++ b/debian/chronyd-starter.sh
@@ -0,0 +1,70 @@
1#!/bin/sh
2set -ue
3
4CONF="/etc/default/chrony"
5DOC="/usr/share/doc/chrony/README.container"
6CAP="cap_sys_time"
7CMD="/usr/sbin/chronyd"
8# Take any args passed, use none if nothing was specified
9EFFECTIVE_DAEMON_OPTS=${@:-""}
10
11if [ -f "${CONF}" ]; then
12 . "${CONF}"
13else
14 echo "<4>Warning: ${CONF} is missing"
15fi
16# take from conffile if available, default to no otherwise
17EFFECTIVE_SYNC_IN_CONTAINER=${SYNC_IN_CONTAINER:-"no"}
18
19if [ ! -x "${CMD}" ]; then
20 echo "<3>Error: ${CMD} not executable"
21 # ugly, but works around https://github.com/systemd/systemd/issues/2913
22 sleep 0.1
23 exit 1
24fi
25
26# Check if -x is already set manually, don't process further if that is the case
27X_SET=0
28while getopts ":x" opt; do
29 case $opt in
30 x)
31 X_SET=1
32 ;;
33 esac
34done
35
36if [ ${X_SET} -ne 1 ]; then
37 # Assume it is not in a container
38 IS_CONTAINER=0
39 if [ -x /usr/bin/systemd-detect-virt ]; then
40 if /usr/bin/systemd-detect-virt --quiet --container; then
41 IS_CONTAINER=1
42 fi
43 fi
44
45
46 # Assume it has the cap
47 HAS_CAP=1
48 CAPSH="/sbin/capsh"
49 if [ -x "${CAPSH}" ]; then
50 ${CAPSH} --print | grep -q "^Current.*${CAP}" || HAS_CAP=0
51 fi
52
53 if [ ${HAS_CAP} -eq 0 ]; then
54 echo "<4>Warning: Missing ${CAP}, syncing the system clock will fail"
55 fi
56 if [ ${IS_CONTAINER} -eq 1 ]; then
57 echo "<4>Warning: Running in a container, likely impossible and unintended to sync system clock"
58 fi
59
60 if [ ${HAS_CAP} -eq 0 -o ${IS_CONTAINER} -eq 1 ]; then
61 if [ "${EFFECTIVE_SYNC_IN_CONTAINER}" != "yes" ]; then
62 echo "<5>Adding -x as fallback disabling control of the system clock, see ${DOC} to override this behavior"
63 EFFECTIVE_DAEMON_OPTS="${EFFECTIVE_DAEMON_OPTS} -x"
64 else
65 echo "<5>Not falling back to disable control of the system clock, see ${DOC} to change this behavior"
66 fi
67 fi
68fi
69
70${CMD} ${EFFECTIVE_DAEMON_OPTS}
diff --git a/debian/control b/debian/control
index 0da2ecf..197ae0c 100644
--- a/debian/control
+++ b/debian/control
@@ -1,7 +1,8 @@
1Source: chrony1Source: chrony
2Section: net2Section: net
3Priority: optional3Priority: optional
4Maintainer: Vincent Blut <vincent.debian@free.fr>4Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
5XSBC-Original-Maintainer: Vincent Blut <vincent.debian@free.fr>
5Uploaders: Joachim Wiedorn <joodebian@joonet.de>6Uploaders: Joachim Wiedorn <joodebian@joonet.de>
6Standards-Version: 4.3.07Standards-Version: 4.3.0
7Build-Depends: asciidoctor (>= 1.5.3-1~),8Build-Depends: asciidoctor (>= 1.5.3-1~),
@@ -26,6 +27,7 @@ Architecture: linux-any
26Pre-Depends: ${misc:Pre-Depends}27Pre-Depends: ${misc:Pre-Depends}
27Depends: adduser,28Depends: adduser,
28 iproute2 [linux-any],29 iproute2 [linux-any],
30 libcap2-bin,
29 ucf,31 ucf,
30 ${misc:Depends},32 ${misc:Depends},
31 ${shlibs:Depends}33 ${shlibs:Depends}
diff --git a/debian/docs b/debian/docs
index e12f653..3bfc9dc 100644
--- a/debian/docs
+++ b/debian/docs
@@ -1,3 +1,4 @@
1FAQ1FAQ
2NEWS2NEWS
3README3README
4debian/README.container
diff --git a/debian/install b/debian/install
index db2e305..abaa2f3 100644
--- a/debian/install
+++ b/debian/install
@@ -2,3 +2,4 @@ debian/chrony-dnssrv@.* lib/systemd/system
2debian/chrony-helper usr/lib/chrony2debian/chrony-helper usr/lib/chrony
3debian/chrony.conf usr/share/chrony3debian/chrony.conf usr/share/chrony
4debian/usr.sbin.chronyd etc/apparmor.d4debian/usr.sbin.chronyd etc/apparmor.d
5debian/chronyd-starter.sh usr/lib/systemd/scripts/

Subscribers

People subscribed via source and target branches