From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 43899138334 for ; Tue, 4 Sep 2018 09:32:32 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3BDD3E07EE; Tue, 4 Sep 2018 09:32:31 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 0316AE07EE for ; Tue, 4 Sep 2018 09:32:30 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 15794335CA7 for ; Tue, 4 Sep 2018 09:32:28 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id E9FE3392 for ; Tue, 4 Sep 2018 09:32:25 +0000 (UTC) From: "Jeroen Roovers" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Jeroen Roovers" Message-ID: <1536053539.6e9478074f14ff36bd4beb516f8ba144bef45201.jer@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/chrony/files/, net-misc/chrony/ X-VCS-Repository: repo/gentoo X-VCS-Files: net-misc/chrony/chrony-3.4_pre1-r1.ebuild net-misc/chrony/chrony-3.4_pre1.ebuild net-misc/chrony/files/chronyd.init-r2 X-VCS-Directories: net-misc/chrony/files/ net-misc/chrony/ X-VCS-Committer: jer X-VCS-Committer-Name: Jeroen Roovers X-VCS-Revision: 6e9478074f14ff36bd4beb516f8ba144bef45201 X-VCS-Branch: master Date: Tue, 4 Sep 2018 09:32:25 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 045355a4-55a3-49ff-9063-250a464a5e74 X-Archives-Hash: e6b0c5f7ee46e6a7baa0be0a7718c26c commit: 6e9478074f14ff36bd4beb516f8ba144bef45201 Author: Jeroen Roovers gentoo org> AuthorDate: Tue Sep 4 09:31:04 2018 +0000 Commit: Jeroen Roovers gentoo org> CommitDate: Tue Sep 4 09:32:19 2018 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6e947807 net-misc/chrony: Set default PID file and check for it Fixes: https://bugs.gentoo.org/665212 Package-Manager: Portage-2.3.49, Repoman-2.3.10 ...y-3.4_pre1.ebuild => chrony-3.4_pre1-r1.ebuild} | 12 ++-- net-misc/chrony/files/chronyd.init-r2 | 70 ++++++++++++++++++++++ 2 files changed, 76 insertions(+), 6 deletions(-) diff --git a/net-misc/chrony/chrony-3.4_pre1.ebuild b/net-misc/chrony/chrony-3.4_pre1-r1.ebuild similarity index 93% rename from net-misc/chrony/chrony-3.4_pre1.ebuild rename to net-misc/chrony/chrony-3.4_pre1-r1.ebuild index c3aed38aa99..a39dc7b24dc 100644 --- a/net-misc/chrony/chrony-3.4_pre1.ebuild +++ b/net-misc/chrony/chrony-3.4_pre1-r1.ebuild @@ -38,9 +38,8 @@ S="${WORKDIR}/${P/_/-}" src_prepare() { sed -i \ - -e 's:/etc/chrony\.:/etc/chrony/chrony.:g' \ - -e 's:/var/run:/run:g' \ - conf.c doc/*.man.in examples/* || die + -e 's:/etc/chrony\.conf:/etc/chrony/chrony.conf:g' \ + doc/* examples/* || die default } @@ -75,12 +74,13 @@ src_configure() { $(usex rtc '' --disable-rtc) \ ${CHRONY_EDITLINE} \ ${EXTRA_ECONF} \ - --docdir=/usr/share/doc/${PF} \ --chronysockdir=/run/chrony \ + --disable-sechash \ + --docdir=/usr/share/doc/${PF} \ --mandir=/usr/share/man \ --prefix=/usr \ --sysconfdir=/etc/chrony \ - --disable-sechash \ + --with-pidfile="${EPREFIX}/run/chrony/chronyd.pid" --without-nss \ --without-tomcrypt " @@ -97,7 +97,7 @@ src_compile() { src_install() { default - newinitd "${FILESDIR}"/chronyd.init-r1 chronyd + newinitd "${FILESDIR}"/chronyd.init-r2 chronyd newconfd "${FILESDIR}"/chronyd.conf chronyd insinto /etc/${PN} diff --git a/net-misc/chrony/files/chronyd.init-r2 b/net-misc/chrony/files/chronyd.init-r2 new file mode 100644 index 00000000000..4892a57b163 --- /dev/null +++ b/net-misc/chrony/files/chronyd.init-r2 @@ -0,0 +1,70 @@ +#!/sbin/openrc-run +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +depend() { + use dns +} + +checkconfig() { + # Note that /etc/chrony/chrony.keys is *NOT* checked. This + # is because the user may have specified another key + # file, and we don't want to force the user to use that + # exact name for the key file. + if [ ! -f "${CFGFILE}" ] ; then + eerror "Please create ${CFGFILE} and the" + eerror "chrony key file (usually /etc/chrony/chrony.keys)" + eerror "by using the" + eerror "" + eerror " chrony.conf.example" + eerror " chrony.keys.example" + eerror "" + eerror "files (from the documentation directory)" + eerror "as templates." + return 1 + else + # Actually, I tried it, and chrony seems to ignore the pidfile + # option. I'm going to leave it here anyway, since you never + # know if it might be handy + PIDFILE=`awk '/^ *pidfile/{print $2}' "${CFGFILE}"` + [ -z "${PIDFILE}" ] && PIDFILE=/run/chrony/chronyd.pid + fi + return 0 +} + +setxtrarg() { + if [ -c /dev/rtc ]; then + grep -q '^rtcfile' "${CFGFILE}" && ARGS="${ARGS} -s" + fi + grep -q '^dumponexit$' "${CFGFILE}" && ARGS="${ARGS} -r" + return 0 +} + +start() { + checkconfig || return $? + setxtrarg + + [ -n "${PIDFILE}" ] || PIDFILE=/run/chronyd.pid + + ebegin "Starting chronyd" + start-stop-daemon \ + --start \ + --quiet \ + --exec /usr/sbin/chronyd \ + --pidfile "${PIDFILE}" \ + -- -f "${CFGFILE}" ${ARGS} + eend $? "Failed to start chronyd" +} + +stop() { + checkconfig || return $? + + [ -n "${PIDFILE}" ] || PIDFILE=/run/chronyd.pid + + ebegin "Stopping chronyd" + start-stop-daemon \ + --stop \ + --quiet \ + --pidfile "${PIDFILE}" + eend $? "Failed to stop chronyd" +}