diff options
author | Raúl Porcel <armin76@gentoo.org> | 2008-12-28 12:00:27 +0000 |
---|---|---|
committer | Raúl Porcel <armin76@gentoo.org> | 2008-12-28 12:00:27 +0000 |
commit | 37861c13805cf3f4c2889201b773a1d55ad75a8e (patch) | |
tree | 3cb285a897eb7051b6d065c546f647519a35ee3c /net-p2p/deluge/files | |
parent | Initial import. (diff) | |
download | historical-37861c13805cf3f4c2889201b773a1d55ad75a8e.tar.gz historical-37861c13805cf3f4c2889201b773a1d55ad75a8e.tar.bz2 historical-37861c13805cf3f4c2889201b773a1d55ad75a8e.zip |
Enhance init script, thanks to Alex Kravtsov and Kevin Bowling on bug #238733
Package-Manager: portage-2.1.6.3/cvs/Linux 2.6.27-gentoo-r7 i686
Diffstat (limited to 'net-p2p/deluge/files')
-rw-r--r-- | net-p2p/deluge/files/deluged.conf | 3 | ||||
-rw-r--r-- | net-p2p/deluge/files/deluged.init | 25 |
2 files changed, 25 insertions, 3 deletions
diff --git a/net-p2p/deluge/files/deluged.conf b/net-p2p/deluge/files/deluged.conf index a09d559c273f..1d4714c2fe2f 100644 --- a/net-p2p/deluge/files/deluged.conf +++ b/net-p2p/deluge/files/deluged.conf @@ -2,3 +2,6 @@ # Change this to the user you want to run deluged as. # You may specify a group too, after a colon DELUGED_USER="" +DELUGEUI_START="false" +DELUGEUI_OPTS="-u web" + diff --git a/net-p2p/deluge/files/deluged.init b/net-p2p/deluge/files/deluged.init index 72307769d3c4..5ec69058ece4 100644 --- a/net-p2p/deluge/files/deluged.init +++ b/net-p2p/deluge/files/deluged.init @@ -1,7 +1,7 @@ #!/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.2 2008/07/07 10:39:17 armin76 Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-p2p/deluge/files/deluged.init,v 1.3 2008/12/28 12:00:27 armin76 Exp $ depend() { need net @@ -27,17 +27,28 @@ checkconfig() { eerror "Your group has to exist too!" return 1 fi - fi + fi return 0 } start() { checkconfig || return $? + DELUGED_USER_HOME=`getent passwd | grep $( echo "${DELUGED_USER}" | cut -d ':' -f 1 ) | cut -d ':' -f 6` 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 "${DELUGED_OPTS}" + --exec /usr/bin/deluged -c "${DELUGED_USER}" -e HOME=${DELUGED_USER_HOME} -- --do-not-daemonize "${DELUGED_OPTS}" eend $? + + + if [[ "${DELUGEUI_START}" == "true" ]] ; then + ebegin "Starting Deluge" + start-stop-daemon --start --background --pidfile \ + /var/run/deluge.pid --make-pidfile \ + --exec /usr/bin/deluge -c "${DELUGED_USER}" \ + -e HOME="${DELUGED_USER_HOME}" -- ${DELUGEUI_OPTS} + eend $? + fi } stop() { @@ -45,4 +56,12 @@ stop() { start-stop-daemon --stop --user "${DELUGED_USER}" \ --name deluged --pidfile /var/run/deluged.pid eend $? + + + if [[ "${DELUGEUI_START}" == "true" ]] ; then + ebegin "Stopping Deluge" + start-stop-daemon --stop --user "${DELUGED_USER}" \ + --name deluge --pidfile /var/run/deluge.pid + eend $? + fi } |