diff options
author | Raúl Porcel <armin76@gentoo.org> | 2007-03-05 15:13:52 +0000 |
---|---|---|
committer | Raúl Porcel <armin76@gentoo.org> | 2007-03-05 15:13:52 +0000 |
commit | f85e8fc71b5a02e75a6e5b1cae933704055244b9 (patch) | |
tree | 83728d18934efc8d358f2f742bb15e9cc221511c /net-p2p/btpd/files | |
parent | Replace deprectaed constant with newer one, closes bug #146828 (diff) | |
download | gentoo-2-f85e8fc71b5a02e75a6e5b1cae933704055244b9.tar.gz gentoo-2-f85e8fc71b5a02e75a6e5b1cae933704055244b9.tar.bz2 gentoo-2-f85e8fc71b5a02e75a6e5b1cae933704055244b9.zip |
Version bump, bug 143900 and fix bug 146147, and assign to net-p2p herd
(Portage version: 2.1.2.1)
Diffstat (limited to 'net-p2p/btpd/files')
-rw-r--r-- | net-p2p/btpd/files/confd_btpd | 5 | ||||
-rw-r--r-- | net-p2p/btpd/files/digest-btpd-0.11 | 3 | ||||
-rw-r--r-- | net-p2p/btpd/files/digest-btpd-0.12 | 3 | ||||
-rw-r--r-- | net-p2p/btpd/files/digest-btpd-0.9 | 3 | ||||
-rw-r--r-- | net-p2p/btpd/files/initd_btpd | 79 |
5 files changed, 87 insertions, 6 deletions
diff --git a/net-p2p/btpd/files/confd_btpd b/net-p2p/btpd/files/confd_btpd new file mode 100644 index 000000000000..a7318f64d092 --- /dev/null +++ b/net-p2p/btpd/files/confd_btpd @@ -0,0 +1,5 @@ +# owner of btpd process (must be existing) +#BTPDUSER="p2p" + +# Extra arguments for btpd +#BTPDEXTRARGS="-p 43729" diff --git a/net-p2p/btpd/files/digest-btpd-0.11 b/net-p2p/btpd/files/digest-btpd-0.11 deleted file mode 100644 index 4af56e9f2360..000000000000 --- a/net-p2p/btpd/files/digest-btpd-0.11 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 fff2cdc3c5ff7478e08bde60d95deda8 btpd-0.11.tar.gz 146794 -RMD160 b43bcd6ece668c2f6365a940fdcc49d3275e4abe btpd-0.11.tar.gz 146794 -SHA256 f235667135c67320945788b839c90be8aa6aa8a7ac597c9d8b0841a7942285e2 btpd-0.11.tar.gz 146794 diff --git a/net-p2p/btpd/files/digest-btpd-0.12 b/net-p2p/btpd/files/digest-btpd-0.12 new file mode 100644 index 000000000000..7776bd927316 --- /dev/null +++ b/net-p2p/btpd/files/digest-btpd-0.12 @@ -0,0 +1,3 @@ +MD5 9c2dcdb48b2cd2642c9250635b88c917 btpd-0.12.tar.gz 162543 +RMD160 eaf6df635aae5140689d8547a5a1cefda05c0de4 btpd-0.12.tar.gz 162543 +SHA256 801b2f6f577b8b52f7b5e4c03725ef1808ab8bb7bdd07e0bcf7f319a7cbf2e4c btpd-0.12.tar.gz 162543 diff --git a/net-p2p/btpd/files/digest-btpd-0.9 b/net-p2p/btpd/files/digest-btpd-0.9 deleted file mode 100644 index ef7b1a77961c..000000000000 --- a/net-p2p/btpd/files/digest-btpd-0.9 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 e07689d2da7d24a603da666feb0b45d9 btpd-0.9.tar.gz 146160 -RMD160 ddb40e6ec8967c801219049f032a014145d3934c btpd-0.9.tar.gz 146160 -SHA256 a715e2d03620b62c65c8468425542782133f578ad507cc6915f6724d8172035f btpd-0.9.tar.gz 146160 diff --git a/net-p2p/btpd/files/initd_btpd b/net-p2p/btpd/files/initd_btpd new file mode 100644 index 000000000000..2d54e9bdb758 --- /dev/null +++ b/net-p2p/btpd/files/initd_btpd @@ -0,0 +1,79 @@ +#!/sbin/runscript +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +BTPDUSERHOME=`getent passwd ${BTPDUSER} | cut -d : -f 6` +BTPDHOME=${BTPDUSERHOME}/.btpd +BTPDSTARTUPLOG=${BTPDHOME}/startup.log + +depend() { + need net +} + +checkconfig() { + if [ -z ${BTPDUSER} ]; then + + eerror "Must edit /etc/conf.d/btpd first." + return 1 + + elif [ -z "`getent passwd ${BTPDUSER}`" ]; then + + eerror "Check /etc/conf.d/btpd's \${BTPDUSER}. '${BTPDUSER}' doesn't exist." + return 1 + fi +} + +start() { + + ebegin "Starting BitTorrent Protocol Daemon" + checkconfig || return 1 + + if pgrep -u ${BTPDUSER} btpd >/dev/null; then + eerror "An instance of btpd is already running" + return 1 + else + su ${BTPDUSER} -c "btpd ${BTPDEXTRARGS}" + + sleep 2 + + if ! pgrep -u ${BTPDUSER} btpd > /dev/null; then + eerror "BitTorrent Protocol Daemon couldn't be started ! Check logfile: ${BTPDSTARTUPLOG}" + return 1 + fi + fi + + eend $? +} + +stop() { + checkconfig || return 1 + + local retries=0 + + ebegin "Stopping BitTorrent Protocol Daemon" + while [[ -n "`pgrep -u ${BTPDUSER} btpd`" && ${retries} -lt 4 ]]; do + if test ${retries} -eq 0; then + su ${BTPDUSER} -c "btcli kill" + else + kill -9 "`pgrep -u ${BTPDUSER} btpd`" + fi + + sleep 1 + let retries=$retries+1 + done + + if [ ${retries} -lt 4 ]; then + return 0 + else + eerror "Unable to stop btpd" + return 1 + fi + + eend $? +} + +restart() { + svc_stop + sleep 3 + svc_start +} |