summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Kryczek <mkay@gentoo.org>2005-10-20 23:41:06 +0000
committerMarcin Kryczek <mkay@gentoo.org>2005-10-20 23:41:06 +0000
commit0a17cd0e74ca81ed930775bf9568c131ecf48ce4 (patch)
treeac1a8b2d77bcc3de0792b780cfd7fb712a968b9e /net-p2p/mldonkey
parentAdded optional Octave support, avoid access violations (fixes bug #109684). (diff)
downloadgentoo-2-0a17cd0e74ca81ed930775bf9568c131ecf48ce4.tar.gz
gentoo-2-0a17cd0e74ca81ed930775bf9568c131ecf48ce4.tar.bz2
gentoo-2-0a17cd0e74ca81ed930775bf9568c131ecf48ce4.zip
Updated start script (and configuration in conf.d). This fixes bug #109469 and bug #109604
(Portage version: 2.0.52-r1)
Diffstat (limited to 'net-p2p/mldonkey')
-rw-r--r--net-p2p/mldonkey/ChangeLog6
-rw-r--r--net-p2p/mldonkey/files/mldonkey.confd7
-rw-r--r--net-p2p/mldonkey/files/mldonkey.initd46
3 files changed, 29 insertions, 30 deletions
diff --git a/net-p2p/mldonkey/ChangeLog b/net-p2p/mldonkey/ChangeLog
index f12dd59dbade..d78eb4db9b61 100644
--- a/net-p2p/mldonkey/ChangeLog
+++ b/net-p2p/mldonkey/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for net-p2p/mldonkey
# Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-p2p/mldonkey/ChangeLog,v 1.103 2005/10/15 10:14:10 mkay Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-p2p/mldonkey/ChangeLog,v 1.104 2005/10/20 23:41:06 mkay Exp $
+
+ 20 Oct 2005; <mkay@gentoo.org> files/mldonkey.confd, files/mldonkey.initd:
+ Updated start script (and configuration in conf.d). This fixes bug #109469
+ and bug #109604
15 Oct 2005; <mkay@gentoo.org> mldonkey-2.6.0.ebuild,
mldonkey-2.6.0-r1.ebuild:
diff --git a/net-p2p/mldonkey/files/mldonkey.confd b/net-p2p/mldonkey/files/mldonkey.confd
index 51f53d34db3d..d2a94796b999 100644
--- a/net-p2p/mldonkey/files/mldonkey.confd
+++ b/net-p2p/mldonkey/files/mldonkey.confd
@@ -8,11 +8,8 @@
# owner of mlnet process (don't change, must be existing)
USER="p2p"
-# home dir of owner (don't change, must be existing)
-BASEDIR="/home/p2p"
-
-# subdir if any (will be created, if not existing)
-SUBDIR=".mldonkey"
+# mldonkey's working dir (must be existing)
+MLDONKEY_DIR="/home/p2p/mldonkey"
# logfile (/dev/null for nowhere)
LOG="/var/log/mldonkey.log"
diff --git a/net-p2p/mldonkey/files/mldonkey.initd b/net-p2p/mldonkey/files/mldonkey.initd
index b86a7360f10f..75d1cc739c31 100644
--- a/net-p2p/mldonkey/files/mldonkey.initd
+++ b/net-p2p/mldonkey/files/mldonkey.initd
@@ -7,37 +7,35 @@ depend() {
}
start() {
- result=0
ebegin "Starting mldonkey"
- if [ ! -d ${BASEDIR}/${SUBDIR} ]
- then
- einfo "Directory ${BASEDIR}/${SUBDIR} not existing, trying to create..."
- if [ ! -d ${BASEDIR} ]
- then
- mkdir -p ${BASEDIR}
- chown ${USER}:users ${BASEDIR}
- if [ ! -d ${BASEDIR} ]
- then
- eerror "Directory ${BASEDIR} could not be created!"
- result=$(( ${result} + 1 ))
- fi
- fi
- su ${USER} -c "mkdir ${BASEDIR}/${SUBDIR}"
- if [ ! -d ${BASEDIR}/${SUBDIR} ]
- then
- eerror "Directory ${BASEDIR}/${SUBDIR} could not be created!"
- result=$(( ${result} + 1 ))
+ result=0
+
+ if [ -z "${MLDONKEY_DIR}" ]; then
+ ewarn "mldonkey's start script has been changed. You should remove"
+ ewarn "BASEDIR and SUBDIR from /etc/conf.d/mldonkey and set MLDONKEY_DIR"
+ ewarn "to corect value (you propably want MLDONKEY_DIR=${BASEDIR}/${SUBDIR}"
+ MLDONKEY_DIR=${BASEDIR}/${SUBDIR}
+ einfo "Using ${MLDONKEY_DIR} as working directory"
+ fi
+
+ if [ ! -d ${MLDONKEY_DIR} ]; then
+ einfo "Directory ${MLDONKEY_DIR} not existing, trying to create..."
+ if `mkdir -p ${MLDONKEY_DIR} 2>/dev/null`; then
+ chown ${USER}:users ${MLDONKEY_DIR}
+ else
+ eerror "Directory ${MLDONKEY_DIR} could not be created!"
+ ((result++))
fi
- einfo "...ok!"
fi
- cd ${BASEDIR}/${SUBDIR}/
- env HOME=${BASEDIR} start-stop-daemon --quiet --start -c ${USER} \
- --nicelevel ${NICE} -x /usr/bin/mlnet &>${LOG} &
+
+ cd ${MLDONKEY_DIR}
+ env MLDONKEY_DIR=${MLDONKEY_DIR} start-stop-daemon --quiet --start \
+ -c ${USER} -N ${NICE} -x /usr/bin/mlnet &>${LOG} &
sleep 5
if ! pgrep -u ${USER} mlnet >/dev/null
then
eerror "MLDonkey could not be started! Check logfile: ${LOG}"
- result=$(( ${result} + 1 ))
+ ((result++))
fi
eend $result
}