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 7505F1388C0 for ; Sun, 28 Feb 2016 20:39:02 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C599FE0806; Sun, 28 Feb 2016 20:39:00 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 234B4E0804 for ; Sun, 28 Feb 2016 20:39:00 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0CEED340A42 for ; Sun, 28 Feb 2016 20:38:59 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id AD9AF1606 for ; Sun, 28 Feb 2016 20:38:57 +0000 (UTC) From: "Kristian Fiskerstrand" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Kristian Fiskerstrand" Message-ID: <1456691904.96117d3b7fc98d99bd11a4bf135cfb85fab87024.k_f@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: net-p2p/deluge/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: net-p2p/deluge/files/deluge-web.conf net-p2p/deluge/files/deluge-web.init net-p2p/deluge/files/deluged.conf-2 net-p2p/deluge/files/deluged.init-2 X-VCS-Directories: net-p2p/deluge/files/ X-VCS-Committer: k_f X-VCS-Committer-Name: Kristian Fiskerstrand X-VCS-Revision: 96117d3b7fc98d99bd11a4bf135cfb85fab87024 X-VCS-Branch: master Date: Sun, 28 Feb 2016 20:38:57 +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: 80c05ace-4efb-4fa7-a3d1-bbd170a9b5c9 X-Archives-Hash: 686169a5ce7f0491db9f996cb3fe0375 commit: 96117d3b7fc98d99bd11a4bf135cfb85fab87024 Author: Paolo Pedroni iol it> AuthorDate: Wed Feb 17 10:24:42 2016 +0000 Commit: Kristian Fiskerstrand gentoo org> CommitDate: Sun Feb 28 20:38:24 2016 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=96117d3b net-p2p/deluge: unbundle startup scripts for deluge-web Different startup scripts for daemon and web server. This fixes bug #350213 (thanks to Cameron Tacklind tacklind.com> for inspiration, even though implemented slightly differently) net-p2p/deluge/files/deluge-web.conf | 6 ++++ net-p2p/deluge/files/deluge-web.init | 54 ++++++++++++++++++++++++++++++++++++ net-p2p/deluge/files/deluged.conf-2 | 7 +++++ net-p2p/deluge/files/deluged.init-2 | 54 ++++++++++++++++++++++++++++++++++++ 4 files changed, 121 insertions(+) diff --git a/net-p2p/deluge/files/deluge-web.conf b/net-p2p/deluge/files/deluge-web.conf new file mode 100644 index 0000000..f0aad8f --- /dev/null +++ b/net-p2p/deluge/files/deluge-web.conf @@ -0,0 +1,6 @@ +# /etc/conf.d/deluge-web +# Change this to the user you want to run deluged as. +# You may specify a group too, after a colon +DELUGE_WEB_USER="" +#DELUGE_WEB_HOME="" +DELUGE_WEB_OPTS="" diff --git a/net-p2p/deluge/files/deluge-web.init b/net-p2p/deluge/files/deluge-web.init new file mode 100644 index 0000000..fc540e4 --- /dev/null +++ b/net-p2p/deluge/files/deluge-web.init @@ -0,0 +1,54 @@ +#!/sbin/runscript +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License, v2 or later +# $Id$ + +depend() { + need net +} + +checkconfig() { + if [ "${DELUGE_WEB_USER}" = "" ] ; then + eerror "Please edit /etc/conf.d/deluge-web" + eerror "You have to specify a user to run deluge-web as, as we will not run it as root!" + eerror "Modify DELUGE_WEB_USER to your needs (you can also add a group, after a colon)" + return 1 + fi + if ! getent passwd "${DELUGE_WEB_USER%:*}" >/dev/null ; then + eerror "Please edit /etc/conf.d/deluge-web" + eerror "Your user has to exist!" + return 1 + fi + if [ "${DELUGE_WEB_USER%:*}" = "${DELUGE_WEB_USER}" ] ; then + return 0 + else + if ! getent group "${DELUGE_WEB_USER#*:}" >/dev/null ; then + eerror "Please edit /etc/conf.d/deluge-web" + eerror "Your group has to exist too!" + return 1 + fi + fi + return 0 +} + +start() { + checkconfig || return $? + if [ "${DELUGE_WEB_HOME}" = "" ] ; then + DELUGE_WEB_USER_HOME=$(getent passwd "${DELUGE_WEB_USER%:*}" | cut -d ':' -f 6) + else + DELUGE_WEB_USER_HOME=${DELUGE_WEB_HOME} + fi + ebegin "Starting Deluge-Web" + start-stop-daemon --start --background --pidfile \ + /run/deluge-web.pid --make-pidfile \ + --exec /usr/bin/deluge-web --user "${DELUGE_WEB_USER%:*}" \ + -e HOME="${DELUGE_WEB_USER_HOME}" -- ${DELUGE_WEB_OPTS} + eend $? +} + +stop() { + ebegin "Stopping Deluge-Web" + start-stop-daemon --stop --user "${DELUGE_WEB_USER%:*}" \ + --pidfile /run/deluge-web.pid + eend $? +} diff --git a/net-p2p/deluge/files/deluged.conf-2 b/net-p2p/deluge/files/deluged.conf-2 new file mode 100644 index 0000000..5c507c6 --- /dev/null +++ b/net-p2p/deluge/files/deluged.conf-2 @@ -0,0 +1,7 @@ +# /etc/conf.d/deluged +# Change this to the user you want to run deluged as. +# You may specify a group too, after a colon +DELUGED_USER="" +# DELUGED_UMASK="0002" +# DELUGED_OPTS="-p 58846" + diff --git a/net-p2p/deluge/files/deluged.init-2 b/net-p2p/deluge/files/deluged.init-2 new file mode 100644 index 0000000..082bf9d --- /dev/null +++ b/net-p2p/deluge/files/deluged.init-2 @@ -0,0 +1,54 @@ +#!/sbin/runscript +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License, v2 or later +# $Id$ + +depend() { + need net +} + +checkconfig() { + if [ "${DELUGED_USER}" = "" ] ; then + eerror "Please edit /etc/conf.d/deluged" + eerror "You have to specify a user to run deluged as, as we will not run it as root!" + eerror "Modify DELUGED_USER to your needs (you can also add a group, after a colon)" + return 1 + fi + if ! getent passwd "${DELUGED_USER%:*}" >/dev/null ; then + eerror "Please edit /etc/conf.d/deluged" + eerror "Your user has to exist!" + return 1 + fi + if [ "${DELUGED_USER%:*}" = "${DELUGED_USER}" ] ; then + return 0 + else + if ! getent group "${DELUGED_USER#*:}" >/dev/null ; then + eerror "Please edit /etc/conf.d/deluged" + eerror "Your group has to exist too!" + return 1 + fi + fi + return 0 +} + +start() { + checkconfig || return $? + if [ "${DELUGED_HOME}" = "" ] ; then + DELUGED_USER_HOME=$(getent passwd "${DELUGED_USER%:*}" | cut -d ':' -f 6) + else + DELUGED_USER_HOME=${DELUGED_HOME} + fi + ebegin "Starting Deluged" + start-stop-daemon --start --user "${DELUGED_USER%:*}" \ + --name deluged --pidfile /run/deluged.pid --background --make-pidfile \ + ${DELUGED_UMASK:+--umask ${DELUGED_UMASK}} \ + --exec /usr/bin/deluged -e HOME="${DELUGED_USER_HOME}" -- --do-not-daemonize ${DELUGED_OPTS} + eend $? +} + +stop() { + ebegin "Stopping Deluged" + start-stop-daemon --stop --user "${DELUGED_USER%:*}" \ + --name deluged --pidfile /run/deluged.pid + eend $? +}