1 |
commit: 87242b6f6a92328671131779c43e8f14c64f4252 |
2 |
Author: Sam James (sam_c) <sam <AT> cmpct <DOT> info> |
3 |
AuthorDate: Mon Apr 20 11:44:57 2020 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat May 2 10:43:28 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=87242b6f |
7 |
|
8 |
net-misc/chrony: Sync live ebuild with caps changes |
9 |
|
10 |
This includes the permission fixes from efd09f68d, added to |
11 |
the 9999 ebuild. |
12 |
|
13 |
This should conclude the caps fixes. |
14 |
|
15 |
Signed-off-by: Sam James (sam_c) <sam <AT> cmpct.info> |
16 |
Closes: https://github.com/gentoo/gentoo/pull/15547 |
17 |
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org> |
18 |
|
19 |
net-misc/chrony/chrony-9999.ebuild | 24 ++++++++++++++++++++++-- |
20 |
1 file changed, 22 insertions(+), 2 deletions(-) |
21 |
|
22 |
diff --git a/net-misc/chrony/chrony-9999.ebuild b/net-misc/chrony/chrony-9999.ebuild |
23 |
index 8d8758fa5c6..06eeb9fa032 100644 |
24 |
--- a/net-misc/chrony/chrony-9999.ebuild |
25 |
+++ b/net-misc/chrony/chrony-9999.ebuild |
26 |
@@ -20,14 +20,13 @@ REQUIRED_USE=" |
27 |
" |
28 |
|
29 |
CDEPEND=" |
30 |
- caps? ( sys-libs/libcap ) |
31 |
+ caps? ( acct-group/ntp acct-user/ntp sys-libs/libcap ) |
32 |
libedit? ( dev-libs/libedit ) |
33 |
readline? ( >=sys-libs/readline-4.1-r4:= ) |
34 |
seccomp? ( sys-libs/libseccomp ) |
35 |
" |
36 |
DEPEND=" |
37 |
${CDEPEND} |
38 |
- caps? ( acct-group/ntp acct-user/ntp ) |
39 |
dev-ruby/asciidoctor |
40 |
pps? ( net-misc/pps-tools ) |
41 |
" |
42 |
@@ -135,6 +134,13 @@ src_install() { |
43 |
|
44 |
keepdir /var/{lib,log}/chrony |
45 |
|
46 |
+ if use caps; then |
47 |
+ # Prepare a directory for the chrony.drift file (a la ntpsec) |
48 |
+ # Ensures the environment is sane on new installs |
49 |
+ fowners ntp:ntp /var/{lib,log}/chrony |
50 |
+ fperms 770 /var/lib/chrony |
51 |
+ fi |
52 |
+ |
53 |
insinto /etc/logrotate.d |
54 |
newins "${FILESDIR}"/chrony-2.4-r1.logrotate chrony |
55 |
|
56 |
@@ -143,6 +149,20 @@ src_install() { |
57 |
systemd_enable_ntpunit 50-chrony chronyd.service |
58 |
} |
59 |
|
60 |
+pkg_preinst() { |
61 |
+ HAD_CAPS=false |
62 |
+ |
63 |
+ if has_version 'net-misc/chrony[caps]'; then |
64 |
+ HAD_CAPS=true |
65 |
+ fi |
66 |
+} |
67 |
+ |
68 |
pkg_postinst() { |
69 |
tmpfiles_process chronyd.conf |
70 |
+ |
71 |
+ if use caps && ! ${HAD_CAPS}; then |
72 |
+ ewarn "Please adjust permissions on ${EROOT}/var/{lib,log}/chrony to be owned by ntp:ntp" |
73 |
+ ewarn "e.g. chown -R ntp:ntp ${EROOT}/var/{lib,log}/chrony" |
74 |
+ ewarn "This is necessary for chrony to drop privileges" |
75 |
+ fi |
76 |
} |