mldonkey-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AW: [Mldonkey-users] start mldonkey as daemon??


From: tristate
Subject: AW: [Mldonkey-users] start mldonkey as daemon??
Date: Fri, 10 Jan 2003 14:13:06 +0100

>Hi, if I start mldonkey using ./mldonkey , and I close my telnet to the
server,
>the mldonkey isn't running in the background....
>How can I start mldonkey ass real daemon???
>please mail me...

for redhat user...
copy and paste the snip/snap into a file named "mld".
config your mld-script...
cp mld /etc/init.d/mld
chkconfig /etc/init.d/mld
...now you can disable/enable it on startup with "ntsysv"

i disable it on startup while my isp hangup after 24h.
you can better put it into "/etc/ppp/ip-up" and "/etc/ppp/ip-down"

ip-up:
...
/etc/init.d/mld start
exit 0 < last line

ip-down:
...
/etc/init.d/mld stop
exit 0 < last line

-[SNIP]-----------------------------------------------------------
#!/bin/sh
#
# mlDonkey script modifed for RedHat by tristate
#
# chkconfig: 2345 99 42
# description: mlDonkeyClientScript
#

# Source function library if it exists
test -r /etc/rc.d/init.d/functions && . /etc/rc.d/init.d/functions

# var -- config this lines
AWK=/usr/bin/awk
GREP=/bin/grep
NC=/usr/sbin/nc
SLEEP=/bin/sleep
NICE=18
MLPATH="/mnt/p2p/mlDonkey"
MLBIN="mldonkey"
USER="mldonkey"

# From AUTOCONF
prefix=/usr
exec_prefix=${prefix}

case "$1" in
    start)
        cd $MLPATH
 echo -n $"Starting $MLBIN..."

 rm -Rf servers.ini*
 rm -Rf *.tmp

 su $USER -c "nice -n $NICE ./$MLBIN > /dev/null 2>&1 &"

 $SLEEP 10

 sh -c "$NC localhost 4000 <<STOPHERE
         auth 1234567890
           clh
         add_url server.met
http://tdn-serverlist.no-ip.org/tdn/qlldgylmls/best/server.met
         ovweb
         q
 STOPHERE" > /dev/null

 if [ $? = 0 ] ; then
  touch /var/lock/mldonkey
         echo_success
 else
  echo_failure
 fi
        echo ""
        ;;

    stop)
 cd $MLPATH
        echo -n $"Stopping $MLBIN..."

 sh -c "$NC localhost 4000 <<STOPHERE
        auth 1234567890
        close_fds
        kill
 STOPHERE" > /dev/null

 $SLEEP 10

 ps ax |$GREP mldonkey |grep -v $GREP |$AWK '{print "kill " $1}'|sh

 if [ $? = 0 ] ; then
  rm -f /var/lock/mldonkey
         echo_success
 else
  echo_failure
 fi
        echo ""
        ;;

    restart)
 $0 stop
 $0 start
 ;;

    *)
        echo "Usage: mld {start|stop|restart}"
        exit 1
esac

exit 0
-[SNAP]-----------------------------------------------------------





reply via email to

[Prev in Thread] Current Thread [Next in Thread]