diff options
author | Raúl Porcel <armin76@gentoo.org> | 2008-06-12 15:44:36 +0000 |
---|---|---|
committer | Raúl Porcel <armin76@gentoo.org> | 2008-06-12 15:44:36 +0000 |
commit | 8ba6eedaa31f908c495cfb28f6ab2f9d3b9ff76d (patch) | |
tree | 0fd9a51e073b4c64c89f8f88eb7abcbf46b14496 /net-p2p/deluge/files | |
parent | Version bump, remove old (diff) | |
download | historical-8ba6eedaa31f908c495cfb28f6ab2f9d3b9ff76d.tar.gz historical-8ba6eedaa31f908c495cfb28f6ab2f9d3b9ff76d.tar.bz2 historical-8ba6eedaa31f908c495cfb28f6ab2f9d3b9ff76d.zip |
Add 0.6 livesvn ebuild, bug #220355, thanks to Benedikt Morbach and Andrew Resch
Package-Manager: portage-2.1.5.4
Diffstat (limited to 'net-p2p/deluge/files')
-rw-r--r-- | net-p2p/deluge/files/deluged.conf | 4 | ||||
-rw-r--r-- | net-p2p/deluge/files/deluged.init | 48 |
2 files changed, 52 insertions, 0 deletions
diff --git a/net-p2p/deluge/files/deluged.conf b/net-p2p/deluge/files/deluged.conf new file mode 100644 index 000000000000..a09d559c273f --- /dev/null +++ b/net-p2p/deluge/files/deluged.conf @@ -0,0 +1,4 @@ +# /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="" diff --git a/net-p2p/deluge/files/deluged.init b/net-p2p/deluge/files/deluged.init new file mode 100644 index 000000000000..e5b89f3fae51 --- /dev/null +++ b/net-p2p/deluge/files/deluged.init @@ -0,0 +1,48 @@ +#!/sbin/runscript +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License, v2 or later +# $Header: /var/cvsroot/gentoo-x86/net-p2p/deluge/files/deluged.init,v 1.1 2008/06/12 15:44:36 armin76 Exp $ + +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 | cut -d ':' -f 1 | grep $( echo "${DELUGED_USER}" | cut -d ':' -f 1 ) -sq` ; then + eerror "Please edit /etc/conf.d/deluged" + eerror "Your user has to exist!" + return 1 + fi + if ! `echo "${DELUGED_USER}" | grep ':' -sq` ; then + return 0 + else + if ! `cut -d ':' -f 1 /etc/group | grep $( echo "${DELUGED_USER}" | cut -d ':' -f 2 ) -sq` ; then + eerror "Please edit /etc/conf.d/deluged" + eerror "Your group has to exist too!" + return 1 + fi + fi + return 0 +} + +start() { + checkconfig || return $? + ebegin "Starting Deluged" + start-stop-daemon --start --user "${DELUGED_USER}" \ + --name deluged --pidfile /var/run/deluged.pid --background --make-pidfile \ + --exec /usr/bin/deluged -- --do-not-daemonize "${DELUDED_OPTS}" + eend $? +} + +stop() { + ebegin "Stopping Deluged" + start-stop-daemon --stop --user "${DELUGED_USER}" \ + --name deluged --pidfile /var/run/deluged.pid + eend $? +} |