You are not logged in.

#1 2004-10-25 22:06:46

kog
Member
From: Earth/Europe/Poland/Gdynia
Registered: 2003-06-02
Posts: 16
Website

mldonkey 2.5.22 with daemon script

I created PKGBUILD file

 
# Contributor: Tomasz Bakiera <tbakiera@interia.pl>
pkgname=mldonkey
pkgver=2.5.22
pkgrel=1
pkgdesc="Multiple p2p client"
url="http://mldonkey.org"
license=""
depends=(sysvinit glibc)
makedepends=()
conflicts=()
replaces=()
backup=()
install=
source=(http://savannah.nongnu.org/download/mldonkey/$pkgname-$pkgver.tar.gz mldonkeyd)
md5sums=('958ffb63dbcfcb0f6e48788774dfbb42' '0e468234aaad730b39326130fb11c5ac')

build() {
  cd $startdir/src/$pkgname-$pkgver
  ./configure --prefix=/usr --enable-batch
  make || return 1
  make prefix=$startdir/pkg/usr install
  install -D -m700 ../../mldonkeyd $startdir/pkg/etc/rc.d/mldonkeyd
}  

with the file mldonkeyd (based on mysqld script)

#!/bin/bash 

MLDONKEY_ROOT="/home/mldonkeyd"

# general config
. /etc/rc.conf
. /etc/rc.d/functions

PID=`pidof -o %PPID /usr/bin/mlnet`
if [ ! `egrep '^mldonkeyd:' /etc/group` ]; then
  stat_busy "Adding mldonkeyd group"
  groupadd mldonkeyd
  stat_done
fi
if [ ! `egrep '^mldonkeyd:' /etc/passwd` ]; then
  stat_busy "Adding mldonkeyd user"
  useradd -g mldonkeyd -d $MLDONKEY_ROOT -s /bin/sh mldonkeyd
  [ -d $MLDONKEY_ROOT ] && chown -R mldonkeyd.mldonkeyd $MLDONKEY_ROOT
  stat_done
fi

if [ ! -d $MLDONKEY_ROOT ]; then
  stat_busy "Creating mldonkeyd path"
  mkdir $MLDONKEY_ROOT
  chown -R mldonkeyd.mldonkeyd $MLDONKEY_ROOT
fi

case "$1" in
  start)
    stat_busy "Starting MLDonkey"
    if [ -z "$PID" ]; then
        cd $MLDONKEY_ROOT
    # Remove tmp files
    rm -rf *.tmp
    # Run MLDonkey
    su mldonkeyd -c "nice -n 19 /usr/bin/mlnet -daemon &> /dev/null"
        if [ $? -gt 0 ]; then
         stat_fail
        exit 1
      else
        sleep 1 # wait on children
        echo `pidof -o %PPID /usr/bin/mlnet` > /var/run/mldonkeyd.pid
        add_daemon mldonkeyd
        stat_done
      fi
    else
      stat_fail
      exit 1
    fi
    ;;#!/bin/bash 

MLDONKEY_ROOT="/home/mldonkeyd"

# general config
. /etc/rc.conf
. /etc/rc.d/functions

PID=`pidof -o %PPID /usr/bin/mlnet`
if [ ! `egrep '^mldonkeyd:' /etc/group` ]; then
  stat_busy "Adding mldonkeyd group"
  groupadd mldonkeyd
  stat_done
fi
if [ ! `egrep '^mldonkeyd:' /etc/passwd` ]; then
  stat_busy "Adding mldonkeyd user"
  useradd -g mldonkeyd -d $MLDONKEY_ROOT -s /bin/sh mldonkeyd
  [ -d $MLDONKEY_ROOT ] && chown -R mldonkeyd.mldonkeyd $MLDONKEY_ROOT
  stat_done
fi

if [ ! -d $MLDONKEY_ROOT ]; then
  stat_busy "Creating mldonkeyd path"
  mkdir $MLDONKEY_ROOT
  chown -R mldonkeyd.mldonkeyd $MLDONKEY_ROOT
fi


case "$1" in
  start)
    stat_busy "Starting MLDonkey"
    if [ -z "$PID" ]; then
        cd $MLDONKEY_ROOT
    # Remove tmp files
    rm -rf *.tmp
    # Run MLDonkey
    su mldonkeyd -c "nice -n 19 /usr/bin/mlnet -daemon &> /dev/null"
        if [ $? -gt 0 ]; then
         stat_fail
        exit 1
      else
        sleep 1 # wait on children
        echo `pidof -o %PPID /usr/bin/mlnet` > /var/run/mldonkeyd.pid
        add_daemon mldonkeyd
        stat_done
      fi
    else
      stat_fail
      exit 1
    fi
    ;;

  stop)
    stat_busy "Stopping MLDonkey"
    [ ! -z "$PID" ]  && kill $PID &> /dev/null
    if [ $? -gt 0 ]; then
      stat_fail
      exit 1
    else
      rm /var/run/mldonkeyd.pid &> /dev/null
      rm_daemon mldonkeys
      stat_done
    fi
    ;;

  restart)
    $0 stop
    sleep 3
    $0 start
    ;;
  *)
    echo "usage: $0 {start|stop|restart}"  
esac
exit 0starting


  stop)
    stat_busy "Stopping MLDonkey"
    [ ! -z "$PID" ]  && kill $PID &> /dev/null
    if [ $? -gt 0 ]; then
      stat_fail
      exit 1
    else
      rm /var/run/mldonkeyd.pid &> /dev/null
      rm_daemon mldonkeys
      stat_done
    fi
    ;;

  restart)
    $0 stop
    sleep 3
    $0 start
    ;;
  *)
    echo "usage: $0 {start|stop|restart}"  
esac
exit 0

What you need is to have a network conection when compiling (caml download needed to compile).

If you add 'mldonkeyd' in /etc/rc.d file (daemons section) it will start with system.
mldonkey startup script creating mldonkeyd user/group with home directory stored
in $MLDONKEY_ROOT (change it if you want) .

Please let me know about errors in this files


--
Tomasz Bakiera, jabber: kog@jabber.wp.pl
http://www.oxiv.net

Offline

#2 2004-10-25 22:53:21

celeron2002
Member
From: Santiago, Chile.
Registered: 2004-02-18
Posts: 150

Re: mldonkey 2.5.22 with daemon script

mmm, i compile the package and when i try start the daemon, this is the ouput

[root@Celerondomain pkgbuilds]# /etc/rc.d/mldonkeyd 
/etc/rc.d/mldonkeyd: line 9: -o: command not found
/etc/rc.d/mldonkeyd: line 10: syntax error near unexpected token `then'
/etc/rc.d/mldonkeyd: line 10: `then'

:?


irc.bsd.cl #linux
irc.freenode.org #archlinux-es

Offline

#3 2004-10-25 22:57:24

celeron2002
Member
From: Santiago, Chile.
Registered: 2004-02-18
Posts: 150

Re: mldonkey 2.5.22 with daemon script

pkgname=kmldonkey
pkgver=0.10pre4
pkgrel=1
pkgdesc="KMLDonkey is a frontend for MLDonkey, a powerful P2P file sharing
tool, designed for the KDE desktop"
url="http://www.kmldonkey.org/"
depends=('kdelibs' 'qt')
source=(http://savannah.nongnu.org/download/$pkgname/$pkgname-$pkgver.tar.
md5sums=(096a45c5202c7d7aa82b8a868300efde)

build() {
  cd $startdir/src/$pkgname-$pkgver
  ./configure --prefix=/opt/kde
  make || return 1
  make prefix=$startdir/pkg/opt/kde install
}

this is a pkgbuild for kmldonkey ( a gui for mldonkey ) , the pkgbuild is based on  this post...
http://bbs.archlinux.org/viewtopic.php? … t=mldonkey[/code]


irc.bsd.cl #linux
irc.freenode.org #archlinux-es

Offline

#4 2004-10-26 10:11:30

kog
Member
From: Earth/Europe/Poland/Gdynia
Registered: 2003-06-02
Posts: 16
Website

Re: mldonkey 2.5.22 with daemon script

celeron2002 wrote:

mmm, i compile the package and when i try start the daemon, this is the ouput

[root@Celerondomain pkgbuilds]# /etc/rc.d/mldonkeyd 
/etc/rc.d/mldonkeyd: line 9: -o: command not found
/etc/rc.d/mldonkeyd: line 10: syntax error near unexpected token `then'
/etc/rc.d/mldonkeyd: line 10: `then'

:?

I think it is package missing. At the moment not sure which one
is responsible for this error (maybe perl, I'm not developer).
Does anybody know where is the error, on mine system it is working.
Not sure in 100% it is package responsible for 'pidof' command
or something else.


--
Tomasz Bakiera, jabber: kog@jabber.wp.pl
http://www.oxiv.net

Offline

#5 2004-10-26 13:44:17

kog
Member
From: Earth/Europe/Poland/Gdynia
Registered: 2003-06-02
Posts: 16
Website

Re: mldonkey 2.5.22 with daemon script

I think I found it big_smile
Try to install sysinit package
it means dependencies line should look slike this
depends (sysvinit)


--
Tomasz Bakiera, jabber: kog@jabber.wp.pl
http://www.oxiv.net

Offline

#6 2004-10-26 23:36:34

celeron2002
Member
From: Santiago, Chile.
Registered: 2004-02-18
Posts: 150

Re: mldonkey 2.5.22 with daemon script

this is working, thanx wink


irc.bsd.cl #linux
irc.freenode.org #archlinux-es

Offline

#7 2004-11-14 14:15:31

bigh
Member
From: Zurich, Switzerland
Registered: 2004-03-23
Posts: 62

Re: mldonkey 2.5.22 with daemon script

I have the following error message while building the mldonked package:

==> ERROR: mldonkeyd was not found in the build directory and is not a proper URL.
==> Aborting...

Offline

#8 2004-11-14 15:50:12

bigh
Member
From: Zurich, Switzerland
Registered: 2004-03-23
Posts: 62

Re: mldonkey 2.5.22 with daemon script

problem solved

Offline

#9 2004-11-14 17:05:05

kog
Member
From: Earth/Europe/Poland/Gdynia
Registered: 2003-06-02
Posts: 16
Website

Re: mldonkey 2.5.22 with daemon script

bigh wrote:

problem solved

What was that ??


--
Tomasz Bakiera, jabber: kog@jabber.wp.pl
http://www.oxiv.net

Offline

#10 2004-11-17 14:54:20

bigh
Member
From: Zurich, Switzerland
Registered: 2004-03-23
Posts: 62

Re: mldonkey 2.5.22 with daemon script

I didnt had the mldonkeyd script in the build directory.. Sorry very stupid..

Shame on me!

Offline

Board footer

Powered by FluxBB