summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Korepanov <kaikaikai@yandex.ru>2016-04-12 14:28:41 +0100
committerAnthony G. Basile <blueness@gentoo.org>2016-05-09 04:05:40 -0400
commit77e39b3f8132f473e6addffd287b0b42f593c967 (patch)
tree8376baa3d43c8d3d42372c34f188e068f744df2b /net-misc
parentnet-misc/i2pd: add more docs (diff)
downloadgentoo-77e39b3f8132f473e6addffd287b0b42f593c967.tar.gz
gentoo-77e39b3f8132f473e6addffd287b0b42f593c967.tar.bz2
gentoo-77e39b3f8132f473e6addffd287b0b42f593c967.zip
net-misc/i2pd: start-stop-daemon: remove spaces in --retry
Diffstat (limited to 'net-misc')
-rw-r--r--net-misc/i2pd/files/i2pd-2.6.0-r3.initd46
-rw-r--r--net-misc/i2pd/i2pd-2.6.0-r3.ebuild2
2 files changed, 47 insertions, 1 deletions
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 000000000000..81739e9cc34b
--- /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 a35e3f1af3df..a2d40f4d8a7c 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