Early seeders
De Wiki de la communauté Mandriva.
Sommaire |
Présentation
Qu'est ce qu'un early seeder ?
Un early seeder est une personne qui va partager une partie de sa bande passante afin de diffuser les torrents mis à disposition par Mandriva. Les Early seeders disposent des torrents avant le grand public afin que chacun ait les iso complets avant la ruée.
Je dirai qu'il y a même deux types de early seeders :
- Ceux qui partagent pendant une quizaine de jours après la sortie officielle.
- Ceux qui partagent ces iso tout au long de l'année sans discontinuer. (ils deviennent alors plutôt des seeders)
Pourquoi s'inscrire ?
Quand et comment s'inscrire ?
Une dizaine de jours avant la sortie officielle de la future version, rendez-vous sur cette page et cliquez sur le bouton Subscribe to the early seeders program (vous devez posséder un compte, si vous n'en avez pas encore, vous pouvez en créer un en suivant instructions). Un message devrait également être posté dans la partie Nouvelles & Discussions Communauté du forum francophone. Une fois votre inscription effectuée, il ne vous reste plus qu'à attendre que l'on vous contacte par mail pour vous indiquer le lien vers les fichiers torrent généralement 3-4 jours avant la sortie officielle.
Automatiser le partage
Même si un simple client torrent suffit à partager, certain souhaiteront peut-être aller plus loin... Si c'est votre cas, alors cette section est pour vous.
Objectifs
- légèreté : choix du client torrent (faible consommation mémoire/processeur)
- automatisme : pas besoin de se soucier du lancement d'un logiciel X
- simplicité : on place juste les .torrent dans le dossier adéquat, il fait le reste.
Idées générales
On crée un utilisateur torrentd qui sera en charge d'executer le démon (on évite ainsi de lancer un client torrent en root !) La localisation des fichiers est /var/torrentd, un choix personnel.
Il y aura les fichiers et répertoires suivants :
- downloaded/ : fichiers en cours de téléchargement / téléchargé (il doit y avoir un moyen de séparer, je n'ai pas cherché)
- session/ : le .lock et autres fichiers nécessaires à rTorrent.
- torrent/ : les torrents à télécharger/partager.
- .rtorrent.rc : le fichier de conf.
Mise en place
- installer rtorrent, dtach
- Création d'un groupe pour le démon
- Ajout de l'utilisateur principal
- Créations de fichiers spécifiques au démon
Ce fichier de configuration sera à modifier par vos soins ou prendre celui proposé plus bas.
Création des deux répertoires :
mkdir /var/torrentd/downloaded mkdir /var/torrentd/torrent
- Modification du propriétaire de l'ensemble des fichiers ( -R : récursif)
- Mise en place des runlevels
- runlevel 0 : halt (Arrêt)
- runlevel 5 : X11 (Lancement du serveur graphique)
note : si c'est un serveur qui ne possède pas de serveur graphique par exemple, il est nécessaire de changer le runlevel. Mais si tel est le cas, je suis certain que vous n'êtes pas perdu :)
- runlevel 6 : reboot (redémarrage)
- Mise en place du service
On copie le script ci-dessous dans un fichier torrentd dans /etc/init.d/
- Option : Ajout de utilisateur au groupe torrentd pour qu'il puisse gérer les torrents
chmod -R g+wr /var/torrentd/ usermod -G torrentd utilisateur
Service
#!/bin/sh
############################################################
# This script is developped for Mandriva
# Service torrentd
###########################################################
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
############################################################
#
# Written by Spip <unpeudescience at gmail dot com>
# Version 0.1
#
############################################################
SERVICE_NAME="torrentd"
SERVICE_DIRECTORY="/usr/bin/rtorrent"
HOME="/var/torrentd"
SOCKET="$HOME/rtorrent.dtach"
# Check that networking is configured.
[ -r /etc/sysconfig/network ] || exit 0
. /etc/sysconfig/network
[ ${NETWORKING} = "no" ] && exit 0
# Source function library.
. /etc/rc.d/init.d/functions
usage()
{
gprintf "Usage: %s {start|stop|status|restart}\n" "$0"
}
service_start()
{
#check if a lockfile already existe
if [ -e $HOME/session/rtorrent.lock ]; then
PID=`sed 's/.*:+//' < $HOME/session/rtorrent.lock`
if [ -e /proc/$PID/cmdline ]; then test=`cat /proc/$PID/cmdline`; fi;
#check if the PID is associated to rtorrent
if [ "$test" == "/usr/bin/rtorrent-n-oimport=/var/torrentd/rtorrent.rc" ]; then
gprintf "%s (pid %s) is running...\n" "$SERVICE_NAME" "$PID"
else
rm -f $HOME/session/rtorrent.lock
rm -f $SOCKET
gprintf "Starting %s: " "$SERVICE_NAME"
su - torrentd -c "dtach -n $SOCKET $SERVICE_DIRECTORY -n -o import=$HOME/rtorrent.rc" && success || failure
fi;
else
gprintf "Starting %s: " "$SERVICE_NAME"
su - torrentd -c "dtach -n $SOCKET $SERVICE_DIRECTORY -n -o import=$HOME/rtorrent.rc" && success || failure
fi;
echo
}
service_stop()
{
if [[ -r $HOME/session/rtorrent.lock ]]
then
PID=`sed 's/.*:+//' < $HOME/session/rtorrent.lock`
gprintf "Stopping %s: " "$SERVICE_NAME"
kill -TERM $PID >/dev/null 2>&1 && success || failure
echo
fi
}
service_status()
{
if [[ -r $HOME/session/rtorrent.lock ]]
then
PID=`sed 's/.*:+//' < $HOME/session/rtorrent.lock`
gprintf "%s (pid %s) is running...\n" "$SERVICE_NAME" "$PID"
else
gprintf "%s is down " "$SERVICE_NAME"
fi
}
case $1 in
stop)
service_stop
;;
start)
service_start
;;
restart)
service_stop
sleep 3
service_start
;;
status)
service_status
;;
*)
usage
esac
exit 0
Exemple de fichier de configuration
# This is an example resource file for rTorrent. Copy to # ~/.rtorrent.rc and enable/modify the options as needed. Remember to # uncomment the options you wish to enable. # Maximum and minimum number of peers to connect to per torrent. #min_peers = 40 #max_peers = 100 # Same as above but for seeding completed torrents (-1 = same as downloading) #min_peers_seed = 10 #max_peers_seed = 50 # Maximum number of simultanious uploads per torrent. max_uploads = 6 # Global upload and download rate in KiB. "0" for unlimited. upload_rate = 50 download_rate = 0 # Default directory to save the downloaded torrents. directory = /var/torrentd/downloaded # Default session directory. Make sure you don't run multiple instance # of rtorrent using the same session directory. Perhaps using a # relative path? session = /var/torrentd/session # Watch a directory for new torrents, and stop those that have been # deleted. schedule = watch_directory,5,5,load_start=/var/torrentd/torrent/*.torrent #schedule = untied_directory,5,5,stop_untied= # Close torrents when diskspace is low. schedule = low_diskspace,5,60,close_low_diskspace=300M # Stop torrents when reaching upload ratio in percent, # when also reaching total upload in bytes, or when # reaching final upload ratio in percent. # example: stop at ratio 2.0 with at least 200 MB uploaded, or else ratio 20.0 #schedule = ratio,60,60,"stop_on_ratio=200,200M,2000" # The ip address reported to the tracker. #ip = 127.0.0.1 #ip = rakshasa.no # The ip address the listening socket and outgoing connections is # bound to. #bind = 127.0.0.1 #bind = rakshasa.no # Port range to use for listening. port_range = 6890-6890 # Start opening ports at a random position within the port range. #port_random = no # Check hash for finished torrents. Might be usefull until the bug is # fixed that causes lack of diskspace not to be properly reported. #check_hash = no # Set whetever the client should try to connect to UDP trackers. #use_udp_trackers = yes # Alternative calls to bind and ip that should handle dynamic ip's. #schedule = ip_tick,0,1800,ip=rakshasa #schedule = bind_tick,0,1800,bind=rakshasa # Encryption options, set to none (default) or any combination of the following: # allow_incoming, try_outgoing, require, require_RC4, enable_retry, prefer_plaintext # # The example value allows incoming encrypted connections, starts unencrypted # outgoing connections but retries with encryption if they fail, preferring # plaintext to RC4 encryption after the encrypted handshake # # encryption = allow_incoming,enable_retry,prefer_plaintext # Enable DHT support for trackerless torrents or when all trackers are down. # May be set to "disable" (completely disable DHT), "off" (do not start DHT), # "auto" (start and stop DHT as needed), or "on" (start DHT immediately). # The default is "off". For DHT to work, a session directory must be defined. # # dht = auto # UDP port to use for DHT. # # dht_port = 6881 # Enable peer exchange (for torrents not marked private) # # peer_exchange = yes # # Do not modify the following parameters unless you know what you're doing. # # Hash read-ahead controls how many MB to request the kernel to read # ahead. If the value is too low the disk may not be fully utilized, # while if too high the kernel might not be able to keep the read # pages in memory thus end up trashing. #hash_read_ahead = 10 # Interval between attempts to check the hash, in milliseconds. #hash_interval = 100 # Number of attempts to check the hash while using the mincore status, # before forcing. Overworked systems might need lower values to get a # decent hash checking rate. #hash_max_tries = 10
Utilisation
L'utilisation est désormais enfantine. On dépose les .torrent dans le répertoire torrent/ et c'est tout !
Pour voir tourner rtorrent sans le couper, on peut utiliser les propriétés de dtach.
Pour attacher le processus torrentd :
où rtorrent.dtach est le socket. Pour quitter, on utilise le raccourcis clavier de dtach qui permet de détacher le processus : <ctrl+\>


