Gentoo Archives: gentoo-commits

From: Jeroen Roovers <jer@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/chrony/, net-misc/chrony/files/
Date: Fri, 04 Dec 2015 06:04:57
Message-Id: 1449209070.65b7de580ed1bd180ab46e1a600a394bca25248b.jer@gentoo
1 commit: 65b7de580ed1bd180ab46e1a600a394bca25248b
2 Author: Jeroen Roovers <jer <AT> gentoo <DOT> org>
3 AuthorDate: Fri Dec 4 06:04:30 2015 +0000
4 Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org>
5 CommitDate: Fri Dec 4 06:04:30 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=65b7de58
7
8 net-misc/chrony: Drop s-s-d --background from init.d script (bug #566972 by Peter Humphrey and Holger Hoffstätte).
9
10 Package-Manager: portage-2.2.26
11
12 .../{chrony-9999.ebuild => chrony-2.2-r1.ebuild} | 8 +--
13 net-misc/chrony/chrony-9999.ebuild | 2 +-
14 net-misc/chrony/files/chronyd.init-r1 | 70 ++++++++++++++++++++++
15 3 files changed, 75 insertions(+), 5 deletions(-)
16
17 diff --git a/net-misc/chrony/chrony-9999.ebuild b/net-misc/chrony/chrony-2.2-r1.ebuild
18 similarity index 92%
19 copy from net-misc/chrony/chrony-9999.ebuild
20 copy to net-misc/chrony/chrony-2.2-r1.ebuild
21 index 2dae405..04ce021 100644
22 --- a/net-misc/chrony/chrony-9999.ebuild
23 +++ b/net-misc/chrony/chrony-2.2-r1.ebuild
24 @@ -3,15 +3,15 @@
25 # $Id$
26
27 EAPI=5
28 -inherit eutils git-r3 systemd toolchain-funcs
29 +inherit eutils systemd toolchain-funcs
30
31 DESCRIPTION="NTP client and server programs"
32 HOMEPAGE="http://chrony.tuxfamily.org/"
33 -EGIT_REPO_URI="git://git.tuxfamily.org/gitroot/chrony/chrony.git"
34 +SRC_URI="http://download.tuxfamily.org/${PN}/${P/_/-}.tar.gz"
35 LICENSE="GPL-2"
36 SLOT="0"
37
38 -KEYWORDS=""
39 +KEYWORDS="~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86"
40 IUSE="caps +cmdmon ipv6 libedit +ntp +phc +pps readline +refclock +rtc selinux +adns"
41 REQUIRED_USE="
42 ?? ( libedit readline )
43 @@ -96,7 +96,7 @@ src_install() {
44
45 doinfo chrony.info*
46
47 - newinitd "${FILESDIR}"/chronyd.init chronyd
48 + newinitd "${FILESDIR}"/chronyd.init-r1 chronyd
49 newconfd "${FILESDIR}"/chronyd.conf chronyd
50
51 insinto /etc/${PN}
52
53 diff --git a/net-misc/chrony/chrony-9999.ebuild b/net-misc/chrony/chrony-9999.ebuild
54 index 2dae405..13709c0 100644
55 --- a/net-misc/chrony/chrony-9999.ebuild
56 +++ b/net-misc/chrony/chrony-9999.ebuild
57 @@ -96,7 +96,7 @@ src_install() {
58
59 doinfo chrony.info*
60
61 - newinitd "${FILESDIR}"/chronyd.init chronyd
62 + newinitd "${FILESDIR}"/chronyd.init-r1 chronyd
63 newconfd "${FILESDIR}"/chronyd.conf chronyd
64
65 insinto /etc/${PN}
66
67 diff --git a/net-misc/chrony/files/chronyd.init-r1 b/net-misc/chrony/files/chronyd.init-r1
68 new file mode 100644
69 index 0000000..80ec855
70 --- /dev/null
71 +++ b/net-misc/chrony/files/chronyd.init-r1
72 @@ -0,0 +1,70 @@
73 +#!/sbin/runscript
74 +# Copyright 1999-2013 Gentoo Foundation
75 +# Distributed under the terms of the GNU General Public License v2
76 +# $Id$
77 +
78 +depend() {
79 + use dns
80 +}
81 +
82 +checkconfig() {
83 + # Note that /etc/chrony/chrony.keys is *NOT* checked. This
84 + # is because the user may have specified another key
85 + # file, and we don't want to force the user to use that
86 + # exact name for the key file.
87 + if [ ! -f "${CFGFILE}" ] ; then
88 + eerror "Please create ${CFGFILE} and the"
89 + eerror "chrony key file (usually /etc/chrony/chrony.keys)"
90 + eerror "by using the"
91 + eerror ""
92 + eerror " chrony.conf.example"
93 + eerror " chrony.keys.example"
94 + eerror ""
95 + eerror "files (from the documentation directory)"
96 + eerror "as templates."
97 + return 1
98 + else
99 + # Actually, I tried it, and chrony seems to ignore the pidfile
100 + # option. I'm going to leave it here anyway, since you never
101 + # know if it might be handy
102 + PIDFILE=`awk '/^ *pidfile/{print $2}' "${CFGFILE}"`
103 + fi
104 + return 0
105 +}
106 +
107 +setxtrarg() {
108 + if [ -c /dev/rtc ]; then
109 + grep -q '^rtcfile' "${CFGFILE}" && ARGS="${ARGS} -s"
110 + fi
111 + grep -q '^dumponexit$' "${CFGFILE}" && ARGS="${ARGS} -r"
112 + return 0
113 +}
114 +
115 +start() {
116 + checkconfig || return $?
117 + setxtrarg
118 +
119 + [ -n "${PIDFILE}" ] || PIDFILE=/run/chronyd.pid
120 +
121 + ebegin "Starting chronyd"
122 + start-stop-daemon \
123 + --start \
124 + --quiet \
125 + --exec /usr/sbin/chronyd \
126 + --pidfile "${PIDFILE}" \
127 + -- -f "${CFGFILE}" ${ARGS}
128 + eend $? "Failed to start chronyd"
129 +}
130 +
131 +stop() {
132 + checkconfig || return $?
133 +
134 + [ -n "${PIDFILE}" ] || PIDFILE=/run/chronyd.pid
135 +
136 + ebegin "Stopping chronyd"
137 + start-stop-daemon \
138 + --stop \
139 + --quiet \
140 + --pidfile "${PIDFILE}"
141 + eend $? "Failed to stop chronyd"
142 +}