From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 1FFB313824A for ; Mon, 9 May 2016 08:08:16 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id EB6D421C11C; Mon, 9 May 2016 08:08:02 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id BE63C21C088 for ; Mon, 9 May 2016 08:08:00 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id AFA85340AB5 for ; Mon, 9 May 2016 08:07:59 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id CC286967 for ; Mon, 9 May 2016 08:07:54 +0000 (UTC) From: "Anthony G. Basile" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Anthony G. Basile" Message-ID: <1462781140.77e39b3f8132f473e6addffd287b0b42f593c967.blueness@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/i2pd/files/, net-misc/i2pd/ X-VCS-Repository: repo/gentoo X-VCS-Files: net-misc/i2pd/files/i2pd-2.6.0-r3.initd net-misc/i2pd/i2pd-2.6.0-r3.ebuild X-VCS-Directories: net-misc/i2pd/ net-misc/i2pd/files/ X-VCS-Committer: blueness X-VCS-Committer-Name: Anthony G. Basile X-VCS-Revision: 77e39b3f8132f473e6addffd287b0b42f593c967 X-VCS-Branch: master Date: Mon, 9 May 2016 08:07:54 +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: 15a921a6-020e-416f-a003-7b43b2e7bbaf X-Archives-Hash: 986cfc918fa44341c251d63295bcbb7d commit: 77e39b3f8132f473e6addffd287b0b42f593c967 Author: Alexey Korepanov yandex ru> AuthorDate: Tue Apr 12 13:28:41 2016 +0000 Commit: Anthony G. Basile gentoo org> CommitDate: Mon May 9 08:05:40 2016 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=77e39b3f net-misc/i2pd: start-stop-daemon: remove spaces in --retry net-misc/i2pd/files/i2pd-2.6.0-r3.initd | 46 +++++++++++++++++++++++++++++++++ net-misc/i2pd/i2pd-2.6.0-r3.ebuild | 2 +- 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/net-misc/i2pd/files/i2pd-2.6.0-r3.initd b/net-misc/i2pd/files/i2pd-2.6.0-r3.initd new file mode 100644 index 0000000..81739e9 --- /dev/null +++ b/net-misc/i2pd/files/i2pd-2.6.0-r3.initd @@ -0,0 +1,46 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +description="C++ daemon for accessing the I2P network" +description_graceful="Graceful shutdown, takes 10 minutes" + +command="/usr/bin/i2pd" +command_args="${I2PD_OPTIONS}" +user="${I2PD_USER}:${I2PD_GROUP}" +start_stop_daemon_args=" + --user \"${user}\" + --pidfile \"${I2PD_PID}\" + --progress --retry 'SIGTERM/20/SIGKILL/20' +" +I2PD_PID_DIR=$(dirname "${I2PD_PID}") + +extra_started_commands="graceful" + +depend() { + use dns logger netmount +} + +start_pre() { + if [ -z "${I2PD_USER}" ] || \ + [ -z "${I2PD_GROUP}" ] || \ + [ -z "${I2PD_PID}" ] || \ + [ -z "${I2PD_LOG}" ] || \ + [ -z "${I2PD_OPTIONS}" ] ; then + eerror "Not all variables I2PD_USER, I2PD_GROUP, I2PD_PID, I2PD_OPTIONS, I2PD_LOG are defined." + eerror "Check your /etc/conf.d/i2pd." + return 1 + fi + checkpath -f -o "${user}" "${I2PD_LOG}" + checkpath -d -m 0750 -o "${user}" "${I2PD_PID_DIR}" +} + +graceful() { + # on SIGINT, i2pd stops accepting tunnels and shuts down in 600 seconds + ebegin "Gracefully stopping i2pd, this takes 10 minutes" + mark_service_stopping + eval start-stop-daemon --stop ${start_stop_daemon_args} \ + --exec "${command}" --retry 'SIGINT/620/SIGTERM/20/SIGKILL/20' + eend $? && mark_service_stopped +} diff --git a/net-misc/i2pd/i2pd-2.6.0-r3.ebuild b/net-misc/i2pd/i2pd-2.6.0-r3.ebuild index a35e3f1..a2d40f4 100644 --- a/net-misc/i2pd/i2pd-2.6.0-r3.ebuild +++ b/net-misc/i2pd/i2pd-2.6.0-r3.ebuild @@ -85,7 +85,7 @@ src_install() { # openrc and systemd daemon routines newconfd "${FILESDIR}/i2pd-2.6.0-r3.confd" i2pd - newinitd "${FILESDIR}/i2pd-2.6.0-r2.initd" i2pd + newinitd "${FILESDIR}/i2pd-2.6.0-r3.initd" i2pd systemd_newunit "${FILESDIR}/i2pd-2.6.0-r2.service" i2pd.service # logrotate