diff options
author | 2020-01-24 16:04:07 +0100 | |
---|---|---|
committer | 2020-01-27 08:32:20 +0200 | |
commit | 8eeaceea9b91ac8f068cdcb333842d7aebb7c9e6 (patch) | |
tree | 689e59d4856b65b60eb3f5ffcdd03d686ef3f7e0 /net-p2p/deluge/files | |
parent | net-im/telegram-desktop-bin: Drop old (diff) | |
download | gentoo-8eeaceea9b91ac8f068cdcb333842d7aebb7c9e6.tar.gz gentoo-8eeaceea9b91ac8f068cdcb333842d7aebb7c9e6.tar.bz2 gentoo-8eeaceea9b91ac8f068cdcb333842d7aebb7c9e6.zip |
net-p2p/deluge: fix deluge-web.init file
Also fixes installation of unwanted files and byte compilation of
python modules. Remove old.
Closes: https://bugs.gentoo.org/705914
Signed-off-by: Paolo Pedroni <paolo.pedroni@iol.it>
Closes: https://github.com/gentoo/gentoo/pull/14425
Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'net-p2p/deluge/files')
-rw-r--r-- | net-p2p/deluge/files/deluge-web.init-2 | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/net-p2p/deluge/files/deluge-web.init-2 b/net-p2p/deluge/files/deluge-web.init-2 new file mode 100644 index 000000000000..72ce74e7a8a5 --- /dev/null +++ b/net-p2p/deluge/files/deluge-web.init-2 @@ -0,0 +1,53 @@ +#!/sbin/openrc-run +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License, v2 or later + +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}" -- --do-not-daemonize ${DELUGE_WEB_OPTS} + eend $? +} + +stop() { + ebegin "Stopping Deluge-Web" + start-stop-daemon --stop --user "${DELUGE_WEB_USER%:*}" \ + --pidfile /run/deluge-web.pid + eend $? +} |