Difference between revisions of "FAQ amuled"

From AMule Project FAQ
Jump to: navigation, search
(Added startup script)
(Startup script: add standard solution for Red Hat (RHEL, Fedora))
 
(9 intermediate revisions by 8 users not shown)
Line 1: Line 1:
 +
<center>
 +
[[FAQ_amuled|English]] |
 +
[[FAQ_amuled-de|Deutsch]] |
 +
[[FAQ_amuled-es|Espa&ntilde;ol]]
 +
</center>
 +
 
[[aMuled]] is a full featured [[aMule]], running without any user interface ([http://www.webopedia.com/TERM/G/Graphical_User_Interface_GUI.html GUI]). It is controlled by remote access through [[aMuleWeb]], [[aMuleCMD]], [[aMuleGUI]] or other [[FAQ_eD2k-Kademlia#What_is_ED2K?|ed2k]] [[FAQ_utils|utilities]].
 
[[aMuled]] is a full featured [[aMule]], running without any user interface ([http://www.webopedia.com/TERM/G/Graphical_User_Interface_GUI.html GUI]). It is controlled by remote access through [[aMuleWeb]], [[aMuleCMD]], [[aMuleGUI]] or other [[FAQ_eD2k-Kademlia#What_is_ED2K?|ed2k]] [[FAQ_utils|utilities]].
  
Line 5: Line 11:
 
'''Please note:''' Remember '''not''' to set your max-Connections higher than 1024, since [[wxBase]] cannot handle more connections.
 
'''Please note:''' Remember '''not''' to set your max-Connections higher than 1024, since [[wxBase]] cannot handle more connections.
  
If you just need to run [[aMule]] on a remote server [[FAQ_aMule#Is there any way to start aMule with no graphical interface?|try Xvfb]] (see [[FAQ_aMule#Can_I_manage_aMule_remotely_through_telnet_in_the_same_way_I_do_with_eDonkey?|this]] too).
+
If you just need to run [[aMule]] on a remote server [[FAQ_aMule#Is there any way to start aMule with no graphical interface?|try Xvfb]] (see [[FAQ_aMule#Can_I_manage_aMule_remotely_through_telnet_in_the_same_way_I_do_with_eDonkey?|this]] too).
  
 
=== Startup script ===
 
=== Startup script ===
Here is an amuled startup script to make amuled start and stop with your computer. It is derived from the one at [[aMuleWeb]], but follows stricter quoting rules, doesn't require a configuration file in /etc/defaults , and doesn't start a web server.
+
Here is an ''amuled'' startup script to make ''amuled'' start and stop with your computer. It is derived from the one at [[aMuleWeb]], but follows stricter quoting rules, doesn't require a configuration file in ''/etc/defaults'', and doesn't start a web server.
Run su, or prefix commands with sudo, to become root.
+
 
Edit the USER= line to set it to your current user (as reported by whoami)
+
Run ''su'', or prefix commands with ''sudo'', to become root.
Copy the script as /etc/init.d/amuled:
+
 
  cp amuled /etc/init.d/amuled
+
Edit the ''USER='' line to set it to your current user (as reported by ''whoami'').
make it executable
+
 
  chmod 755 /etc/init.d/amuled
+
Copy the script as ''/etc/init.d/amuled'':
set it to run at startup
+
 
   #on debian distros:
+
cp amuled /etc/init.d/amuled
 +
 
 +
Make it executable:
 +
 
 +
chmod 755 /etc/init.d/amuled
 +
 
 +
Set it to run at startup:
 +
 
 +
   #on Debian distros:
 
   update-rc.d amuled defaults
 
   update-rc.d amuled defaults
 +
  #on Red Hat distros:
 +
  chkconfig --add amuled
 +
  chkconfig amuled on 2 3 5 .
 
   #on a generic distro
 
   #on a generic distro
 
   ln -s /etc/init.d/amuled /etc/rc0.d/K20amuled;
 
   ln -s /etc/init.d/amuled /etc/rc0.d/K20amuled;
Line 25: Line 42:
 
   ln -s /etc/init.d/amuled /etc/rc5.d/S20amuled
 
   ln -s /etc/init.d/amuled /etc/rc5.d/S20amuled
  
<pre>
+
The script contains the following lines:
#!/bin/bash
+
  
NAME=$(basename "$0")
+
#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+
DAEMON=/usr/bin/amuled
+
NAME=$(basename "$0")
DESC=amuled
+
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
USER=g2p #A user who already ran amule once to configure it.
+
DAEMON=/usr/bin/amuled
 
+
DESC=amuled
test -x "$DAEMON" || exit 0
+
USER=g2p #A user who already ran amule once to configure it.
 
+
case "$1" in
+
test -x "$DAEMON" || exit 0
 +
 +
case "$1" in
 
   start)
 
   start)
 
     echo -n "Starting $DESC: "
 
     echo -n "Starting $DESC: "
Line 57: Line 75:
 
     exit 1
 
     exit 1
 
     ;;
 
     ;;
esac
+
esac
 +
 +
exit 0
 +
 
 +
=== Startup script for RedHat (Fedora, RHEL, Centos, SME7, ...) ===
 +
 
 +
Run ''su'', or prefix commands with ''sudo'', to become root.
 +
 
 +
Edit the ''USER='' line to set it to your current user (as reported by ''whoami'').
 +
 
 +
Copy the script as ''/etc/init.d/amuled'':
 +
 
 +
cp amuled /etc/init.d/amuled
 +
 
 +
Make it executable:
 +
 
 +
chmod 755 /etc/init.d/amuled
 +
 
 +
Then register the service :
 +
 
 +
chkconfig --add amuled
 +
 
 +
The alternate script contains the following lines :
 +
 
 +
#!/bin/sh
 +
# aMule - script shell pour l'arret/demarrage du service
 +
 +
# description: amule p2p download service
 +
# chkconfig: 345 97 03
 +
 +
# Source function library.
 +
. /etc/rc.d/init.d/functions
 +
 +
USER=p2p #A user who already ran amule once to configure it.
 +
 +
RETVAL=0
 +
 +
case "$1" in
 +
start)
 +
  echo -n "Starting amule daemon: "
 +
  daemon --user=$USER amuled -f
 +
  RETVAL=$?
 +
  echo
 +
  [ $RETVAL -eq 0 ] && touch /var/lock/subsys/amule
 +
  ;;
 +
stop)
 +
  echo -n "Stopping amule daemon: "
 +
  killproc amuled
 +
  RETVAL=$?
 +
  rm -f /var/lock/subsys/amule && rm -f /var/lock/amule
 +
  echo
 +
  ;;
 +
status)
 +
  status amuled
 +
  RETVAL=$?
 +
  ;;
 +
restart|force-reload)
 +
  $0 stop
 +
  $0 start
 +
  RETVAL=$?
 +
  ;;
 +
*)
 +
  printf "Usage: %q {start|stop|status|restart|force-reload}\n" "$0" >&2
 +
  exit 1
 +
  ;;
 +
esac
 +
 +
exit $RETVAL
 +
 
 +
 
 +
=== Runscript for Gentoo ===
 +
 
 +
#!/sbin/runscript
 +
# Copyright 1999-2008 Gentoo Foundation
 +
# Distributed under the terms of the GNU General Public License v2
 +
# $Header: $
 +
 +
NAME=$(basename "$0")
 +
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
 +
DAEMON=/usr/bin/amuled
 +
DESC=amuled
 +
USER=foobar
 +
 +
depend()
 +
{
 +
        need net
 +
}
 +
 +
start()
 +
{
 +
        ebegin "Starting $DESC"
 +
        su "$USER" -c "$(printf "%q -f" "$DAEMON" )"
 +
        eend $?
 +
}
 +
 +
stop()
 +
{
 +
        ebegin "Stopping $DESC"
 +
        killall --quiet "$DAEMON"
 +
        eend $?
 +
}
 +
 +
restart()
 +
{
 +
        svc_stop
 +
        svc_start
 +
}
 +
 
 +
=== Script for SUSE ditribution (Novell SUSE Linux, openSUSE) ===
 +
 
 +
#!/bin/bash
 +
#
 +
### BEGIN INIT INFO
 +
# Provides:          amuled
 +
# Required-Start:    $ALL
 +
# Should-Start: $ALL
 +
# Required-Stop:    $ALL
 +
# Should-Stop: $ALL
 +
# Default-Start:    3 5
 +
# Default-Stop:      0 1 2 6
 +
# Short-Description: aMule Daemon
 +
# Description:      Start aMuled, Daemon for aMule
 +
### END INIT INFO
 +
 +
NAME=$(basename "$0")
 +
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
 +
DAEMON=/usr/local/bin/amuled
 +
DESC=amuled
 +
USER=username #A user who already ran amule once to configure it.
 +
 +
test -x "$DAEMON" || exit 0
 +
 +
case "$1" in
 +
  start)
 +
    echo -n "Starting $DESC: "
 +
      su "$USER" -c "$(printf "%q -f" "$DAEMON" )"
 +
    echo "$NAME."
 +
    ;;
 +
  stop)
 +
    echo -n "Stopping $DESC: "
 +
      killall --quiet "$DAEMON"
 +
    echo "$NAME."
 +
    ;;
 +
  restart|force-reload)
 +
    echo -n "Restarting $DESC: "
 +
      killall --quiet "$DAEMON"
 +
    sleep 1
 +
      su "$USER" -c "$(printf "%q -f" "$DAEMON" )"
 +
    ;;
 +
  *)
 +
    printf "Usage: %q {start|stop|restart|force-reload}\n" "$0" >&2
 +
    exit 1
 +
    ;;
 +
esac
 +
 +
exit 0
  
exit 0
+
This script can be inserted in the startup list by making it executable and by running the command [[insserv]] (see man page for more informaion on insserv).
</pre>
+

Latest revision as of 22:22, 3 December 2008

English | Deutsch | Español

aMuled is a full featured aMule, running without any user interface (GUI). It is controlled by remote access through aMuleWeb, aMuleCMD, aMuleGUI or other ed2k utilities.

Stripped from GUI, aMuled has reduced memory and CPU requirements and it can run without X at all.

Please note: Remember not to set your max-Connections higher than 1024, since wxBase cannot handle more connections.

If you just need to run aMule on a remote server try Xvfb (see this too).

Startup script

Here is an amuled startup script to make amuled start and stop with your computer. It is derived from the one at aMuleWeb, but follows stricter quoting rules, doesn't require a configuration file in /etc/defaults, and doesn't start a web server.

Run su, or prefix commands with sudo, to become root.

Edit the USER= line to set it to your current user (as reported by whoami).

Copy the script as /etc/init.d/amuled:

cp amuled /etc/init.d/amuled

Make it executable:

chmod 755 /etc/init.d/amuled

Set it to run at startup:

 #on Debian distros:
 update-rc.d amuled defaults
 #on Red Hat distros:
 chkconfig --add amuled
 chkconfig amuled on 2 3 5 .
 #on a generic distro
 ln -s /etc/init.d/amuled /etc/rc0.d/K20amuled;
 ln -s /etc/init.d/amuled /etc/rc1.d/K20amuled;
 ln -s /etc/init.d/amuled /etc/rc6.d/K20amuled;
 ln -s /etc/init.d/amuled /etc/rc4.d/S20amuled
 ln -s /etc/init.d/amuled /etc/rc5.d/S20amuled

The script contains the following lines:

#!/bin/bash

NAME=$(basename "$0")
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/bin/amuled
DESC=amuled
USER=g2p #A user who already ran amule once to configure it.

test -x "$DAEMON" || exit 0

case "$1" in
 start)
   echo -n "Starting $DESC: "
     su "$USER" -c "$(printf "%q -f" "$DAEMON" )"
   echo "$NAME."
   ;;
 stop)
   echo -n "Stopping $DESC: "
     killall --quiet "$DAEMON"
   echo "$NAME."
   ;;
 restart|force-reload)
   echo -n "Restarting $DESC: "
     killall --quiet "$DAEMON"
   sleep 1
     su "$USER" -c "$(printf "%q -f" "$DAEMON" )"
   ;;
 *)
   printf "Usage: %q {start|stop|restart|force-reload}\n" "$0" >&2
   exit 1
   ;;
esac

exit 0

Startup script for RedHat (Fedora, RHEL, Centos, SME7, ...)

Run su, or prefix commands with sudo, to become root.

Edit the USER= line to set it to your current user (as reported by whoami).

Copy the script as /etc/init.d/amuled:

cp amuled /etc/init.d/amuled

Make it executable:

chmod 755 /etc/init.d/amuled

Then register the service :

chkconfig --add amuled

The alternate script contains the following lines :

#!/bin/sh
# aMule - script shell pour l'arret/demarrage du service

# description: amule p2p download service
# chkconfig: 345 97 03

# Source function library.
. /etc/rc.d/init.d/functions

USER=p2p #A user who already ran amule once to configure it.

RETVAL=0

case "$1" in
start)
  echo -n "Starting amule daemon: "
  daemon --user=$USER amuled -f
  RETVAL=$?
  echo
  [ $RETVAL -eq 0 ] && touch /var/lock/subsys/amule
  ;;
stop)
  echo -n "Stopping amule daemon: "
  killproc amuled
  RETVAL=$?
  rm -f /var/lock/subsys/amule && rm -f /var/lock/amule
  echo
  ;;
status)
  status amuled
  RETVAL=$?
  ;;
restart|force-reload)
  $0 stop
  $0 start
  RETVAL=$?
  ;;
*)
  printf "Usage: %q {start|stop|status|restart|force-reload}\n" "$0" >&2
  exit 1
  ;;
esac

exit $RETVAL


Runscript for Gentoo

#!/sbin/runscript
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

NAME=$(basename "$0")
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/bin/amuled
DESC=amuled
USER=foobar

depend()
{
        need net
}

start()
{
        ebegin "Starting $DESC"
        su "$USER" -c "$(printf "%q -f" "$DAEMON" )"
        eend $?
}

stop()
{
        ebegin "Stopping $DESC"
        killall --quiet "$DAEMON"
        eend $?
}

restart()
{
        svc_stop
        svc_start
}

Script for SUSE ditribution (Novell SUSE Linux, openSUSE)

#!/bin/bash
#
### BEGIN INIT INFO
# Provides:          amuled
# Required-Start:    $ALL
# Should-Start: $ALL
# Required-Stop:     $ALL
# Should-Stop: $ALL
# Default-Start:     3 5
# Default-Stop:      0 1 2 6
# Short-Description: aMule Daemon
# Description:       Start aMuled, Daemon for aMule
### END INIT INFO

NAME=$(basename "$0")
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/local/bin/amuled
DESC=amuled
USER=username #A user who already ran amule once to configure it.

test -x "$DAEMON" || exit 0

case "$1" in
  start)
    echo -n "Starting $DESC: "
      su "$USER" -c "$(printf "%q -f" "$DAEMON" )"
    echo "$NAME."
    ;;
  stop)
    echo -n "Stopping $DESC: "
      killall --quiet "$DAEMON"
    echo "$NAME."
    ;;
  restart|force-reload)
    echo -n "Restarting $DESC: "
      killall --quiet "$DAEMON"
    sleep 1
      su "$USER" -c "$(printf "%q -f" "$DAEMON" )"
    ;;
  *)
    printf "Usage: %q {start|stop|restart|force-reload}\n" "$0" >&2
    exit 1
    ;;
esac

exit 0

This script can be inserted in the startup list by making it executable and by running the command insserv (see man page for more informaion on insserv).