Difference between revisions of "AMule"

From ArchWiki
Jump to navigation Jump to search
m (Usage)
(Rework out-of-date page. amule package has systemd services now.)
Line 5: Line 5:
 
aMule is an eMule-like client for the eD2k and Kademlia networks, supporting multiple platforms.
 
aMule is an eMule-like client for the eD2k and Kademlia networks, supporting multiple platforms.
  
==Installation==
+
===Installation===
 
aMule can be installed with package {{Pkg|amule}}, available in the [[official repositories]].
 
aMule can be installed with package {{Pkg|amule}}, available in the [[official repositories]].
  
 
'''amuled''' is a full featured aMule daemon, running without any user interface (GUI). It is controlled by remote access through aMuleGUI (GTK), aMuleWeb, or aMuleCmd.
 
'''amuled''' is a full featured aMule daemon, running without any user interface (GUI). It is controlled by remote access through aMuleGUI (GTK), aMuleWeb, or aMuleCmd.
  
==Configuration==
+
===Services===
===amuled===
+
The package provides two systemd services: amuled and amuleweb. They can be started as
====Create configuration files====
+
# systemctl start amuled
First we need to create a user for executing amule daemon:
+
# systemctl start amuleweb
# useradd -m -d /srv/amule -s /bin/bash amule
+
 
 +
Once '''amulweb''' service is started it is available at {{ic|http://127.0.0.1:4711}} (or with external address of your host). Default admin password is '''amule'''.
 +
 
 +
===Configuration===
 +
At package installation time a new user account '''amule''' created. This account is used to run systemd services.
 +
 
 +
All configuration and temporary files are kept in amule home directory {{ic|/var/lib/amule}} among them:
 +
* config file for amuled {{ic|/val/lib/amule/.aMule/amule.conf}}
 +
* config file for amuleweb {{ic|/val/lib/amule/.aMule/remote.conf}}
  
Then we start a shell for the new user {{ic|amule}} and run {{ic|amuled}} once to create the configuration files:
 
# su amule
 
$ amuled --ec-config
 
  
Now amuled will ask you for a temporary password, enter something (amule for example, this does not matter), and use Ctrl-C to terminate amuled.
+
At the package instalation time pacman generates a simple amule.conf file with preset external connection password. The same password is used for amuleweb config file. One can use the password for connecting amule from other remote clients such as amule-gui.
  
====Edit configuration files====
+
To re-generate password please run:
Now we need to configure amuled properly.
 
First, we need to set up a password for the external connection of amuled.
 
 
  $ echo -n <your password here> | md5sum | cut -d ' ' -f 1
 
  $ echo -n <your password here> | md5sum | cut -d ' ' -f 1
  
 
The output of the above command is the encrypted password. Now you edit the config file by adding following lines under section [ExternalConnect]:
 
The output of the above command is the encrypted password. Now you edit the config file by adding following lines under section [ExternalConnect]:
{{hc|1=/srv/amule/.aMule/amule.conf|2=
+
{{hc|1=/var/lib/amule/.aMule/amule.conf|2=
 +
[ExternalConnect]
 
AcceptExternalConnections=1
 
AcceptExternalConnections=1
 
ECPassword=<encrypted password>
 
ECPassword=<encrypted password>
 
}}
 
}}
 
====Execute in background====
 
 
# amuled -f
 
 
====Create daemon====
 
{{Note|It is probably better to include these configuration files by default with amule package, like it is done with transmission.}}
 
 
To make amuled run on system start, we need to create the daemon /etc/rc.d/amuled:
 
 
# touch /etc/rc.d/amuled
 
 
Then copy the following to the file:
 
 
{{bc|<nowiki>
 
#!/bin/bash
 
DAEMON=amuled
 
USER=amule
 
 
. /etc/rc.conf
 
. /etc/rc.d/functions
 
 
case "$1" in
 
start)
 
  stat_busy "Starting $DAEMON"
 
  su "$USER" -l -s /bin/sh -c "$(printf "%q -f>/dev/null" "/usr/bin/amuled" )"
 
  if [ $? = 0 ]; then
 
    add_daemon $DAEMON
 
    stat_done
 
  else
 
    stat_fail
 
    exit 1
 
  fi
 
  ;;
 
stop)
 
  stat_busy "Stopping $DAEMON"
 
  killall --quiet --ignore-case "/usr/bin/amuled"
 
  if [ $? = 0 ]; then
 
    rm_daemon $DAEMON
 
    stat_done
 
  else
 
    stat_fail
 
    exit 1
 
  fi
 
  ;;
 
restart|force-reload)
 
  $0 stop
 
  sleep 4 #1 is not enough
 
  $0 start
 
  ;;
 
*)
 
  printf "Usage: %q {start|stop|restart|force-reload}\n" "$0" >&2
 
  exit 1
 
  ;;
 
esac
 
 
exit 0
 
</nowiki>}}
 
 
Make it executable:
 
# chmod 755 /etc/rc.d/amuled
 
 
Add it to your {{ic|/etc/rc.conf}}, so it will be autostarted.
 
DAEMONS=( ... network '''amuled''' ... )
 
  
 
===amuleweb===
 
===amuleweb===
Line 101: Line 41:
 
====Create configuration files====
 
====Create configuration files====
 
Start amuleweb too using the user you just created to create the configuration file:
 
Start amuleweb too using the user you just created to create the configuration file:
  $ amuleweb --write-config --password=''<password here>'' --admin-pass=<web password here>
+
  $ sudo -u amule amuleweb --write-config --password=''<password here>'' --admin-pass=<web password here>
  
 
Note that here, the <password here> is the unencrypted password you used to configure amuled. <web password here> is the unencrypted for the log in on the web interface. This command will write configuration file as such.
 
Note that here, the <password here> is the unencrypted password you used to configure amuled. <web password here> is the unencrypted for the log in on the web interface. This command will write configuration file as such.
 
====Create daemon====
 
{{Out of date|does the package still lack daemon?}}
 
 
Create the daemon {{ic|/etc/rc.d/amuleweb}}:
 
 
# touch /etc/rc.d/amuleweb
 
 
Copy the following to the file.
 
 
{{bc|<nowiki>
 
#!/bin/bash
 
DAEMON=amuleweb
 
USER=amule
 
 
. /etc/rc.conf
 
. /etc/rc.d/functions
 
 
case "$1" in
 
start)
 
  stat_busy "Starting $DAEMON"
 
  su "$USER" -l -s /bin/sh -c "$(printf "%q --quiet &" "/usr/bin/amuleweb" )"
 
  if [ $? = 0 ]; then
 
    add_daemon $DAEMON
 
    stat_done
 
  else
 
    stat_fail
 
    exit 1
 
  fi
 
  ;;
 
stop)
 
  stat_busy "Stopping $DAEMON"
 
  killall --quiet --ignore-case "/usr/bin/amuleweb"
 
  if [ $? = 0 ]; then
 
    rm_daemon $DAEMON
 
    stat_done
 
  else
 
    stat_fail
 
    exit 1
 
  fi
 
  ;;
 
restart|force-reload)
 
  $0 stop
 
  sleep 1
 
  $0 start
 
  ;;
 
*)
 
  printf "Usage: %q {start|stop|restart|force-reload}\n" "$0" >&2
 
  exit 1
 
  ;;
 
esac
 
 
exit 0
 
</nowiki>}}
 
 
Make it executable:
 
# chmod 755 /etc/rc.d/amuleweb
 
 
Also add it to your {{ic|/etc/rc.conf}}, so it will be autostarted.
 
DAEMONS=( ... network amuled '''amuleweb''' ... )
 
 
{{Note|Whichever way you are starting amuleweb, make sure this is done after amuled is up and running, or amuleweb could crash. If this happened, you can't use `rc.d stop` since process is no longer present, so instead just use `rc.d start` again.}}
 
 
{{Note|Do not forget to set amule's shell to '''/bin/false''' as we do not want to give it shell access to the machine. Edit {{ic|/etc/passwd}} and replace '''/bin/bash''' by '''/bin/false''' for user amule:
 
amule:x:1001:1001::/srv/amule:/bin/false
 
}}
 
 
== Usage ==
 
 
You can start the daemons with:
 
# systemctl start amuled
 
# systemctl start amuleweb
 
 
Now you can run '''amulegui''', use '''amulecmd''' or connect to '''amuleweb''' at {{ic|http://127.0.0.1:4711}} (or with external address of your host).
 
  
 
{{Tip|If the default URL for nodes.dat for Kad network does not work, you can get URL from there: [http://nodes-dat.com]}}
 
{{Tip|If the default URL for nodes.dat for Kad network does not work, you can get URL from there: [http://nodes-dat.com]}}
  
 
For further info on using the program, continue to [http://wiki.amule.org/index.php/Getting_Started Getting_Started at aMule wiki].
 
For further info on using the program, continue to [http://wiki.amule.org/index.php/Getting_Started Getting_Started at aMule wiki].

Revision as of 06:50, 5 June 2013

zh-CN:AMule

aMule is an eMule-like client for the eD2k and Kademlia networks, supporting multiple platforms.

Installation

aMule can be installed with package amule, available in the official repositories.

amuled is a full featured aMule daemon, running without any user interface (GUI). It is controlled by remote access through aMuleGUI (GTK), aMuleWeb, or aMuleCmd.

Services

The package provides two systemd services: amuled and amuleweb. They can be started as

# systemctl start amuled
# systemctl start amuleweb

Once amulweb service is started it is available at http://127.0.0.1:4711 (or with external address of your host). Default admin password is amule.

Configuration

At package installation time a new user account amule created. This account is used to run systemd services.

All configuration and temporary files are kept in amule home directory /var/lib/amule among them:

  • config file for amuled /val/lib/amule/.aMule/amule.conf
  • config file for amuleweb /val/lib/amule/.aMule/remote.conf


At the package instalation time pacman generates a simple amule.conf file with preset external connection password. The same password is used for amuleweb config file. One can use the password for connecting amule from other remote clients such as amule-gui.

To re-generate password please run:

$ echo -n <your password here> | md5sum | cut -d ' ' -f 1

The output of the above command is the encrypted password. Now you edit the config file by adding following lines under section [ExternalConnect]:

/var/lib/amule/.aMule/amule.conf
[ExternalConnect]
AcceptExternalConnections=1
ECPassword=<encrypted password>

amuleweb

Note: amuleweb provides much less features than amulegui (and displays much less info on downloads), and it has to ask for password quite often (unless your browser could save it). It is therefore advisable to use amulegui instead (which starts up very fast as well), and if you decide to do so, you could skip this step.

Create configuration files

Start amuleweb too using the user you just created to create the configuration file:

$ sudo -u amule amuleweb --write-config --password=<password here> --admin-pass=<web password here>

Note that here, the <password here> is the unencrypted password you used to configure amuled. <web password here> is the unencrypted for the log in on the web interface. This command will write configuration file as such.

Tip: If the default URL for nodes.dat for Kad network does not work, you can get URL from there: [1]

For further info on using the program, continue to Getting_Started at aMule wiki.