diff --git a/README b/README new file mode 100644 index 0000000000000000000000000000000000000000..0a830211beacdbd6b5f7d5cb5b5e5ee871cc6e82 --- /dev/null +++ b/README @@ -0,0 +1,42 @@ +Background +========== + +The files in this directory contains everything that is needed to set +up the tracker that can be found at + + http://tracker.lysator.liu.se:6969/ + +This is the second reincarnation of the tracker. The first one was +lost shortly after it was set up when the web server was reinstalled +after a cracker wreaked havoc. This time, this package is created, in +the hope that recovery will be faster should a similar disaster happen +again in the future. + +Some residual configuration may still be present in the Lysator system +from the first attempt, so this might not be everything you need to do +to set up a tracker from scratch. + +Installation +============ + +Follow these steps: + +1. Install bittorrent. + + # apt-get install bittorrent + +2. Ensure that sherman:/web/bittorrent is mounted on all of Lysators + CPU servers and workstations as /lysator/bittorrent. + +3. Create an initscript. The supplied one works on Debian: + + # cp bttrack.debian /etc/init.d/debian + +4. Start the daemon: + + # /etc/init.d/debian start + +TODO: + + - rotate the log + - link the initscript so that the tracker starts after a reboot diff --git a/bttrack.debian b/bttrack.debian new file mode 100755 index 0000000000000000000000000000000000000000..35fe3e54fd510e5f56b9123fef76f09b9092d890 --- /dev/null +++ b/bttrack.debian @@ -0,0 +1,86 @@ +#! /bin/sh +# +# bttrack Start and stop bttrack for Lysator, on a Debian system. +# +# Author: Per Cederqvist <ceder@lysator.liu.se> +# +# This file is maintained in the lyskom-tracker Subversion project. + +set -e + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DESC="BitTorrent tracker" +NAME=bttrack +DAEMON=/usr/bin/bttrack +PIDFILE=/var/run/bttrack.pid +SCRIPTNAME=/etc/init.d/bttrack + +# Gracefully exit if the package has been removed. +test -x $DAEMON || exit 0 + +# +# Function that starts the daemon/service. +# +d_start() { + start-stop-daemon --start --quiet \ + --startas $DAEMON \ + --name $NAME \ + -c bittorrent \ + --background \ + --pidfile $PIDFILE \ + --make-pidfile \ + -- \ + --port 6969 \ + --dfile /web/bittorrent/dfile \ + --bind tracker.lysator.liu.se \ + --nat_check 0 \ + --allowed_dir /web/bittorrent/tracker \ + --parse_allowed_interval 1 \ + --logfile /web/bittorrent/bttrack.log \ + --allow_get 1 \ + --keep_dead 1 + +} + +# +# Function that stops the daemon/service. +# +d_stop() { + start-stop-daemon --stop --quiet \ + --name $NAME \ + --user bittorrent \ + --group bittorrent \ + --pidfile $PIDFILE \ + --retry 2 +} + +case "$1" in + start) + echo -n "Starting $DESC: $NAME" + d_start + echo "." + ;; + stop) + echo -n "Stopping $DESC: $NAME" + d_stop + echo "." + ;; + restart|force-reload) + # + # If the "reload" option is implemented, move the "force-reload" + # option to the "reload" entry above. If not, "force-reload" is + # just the same as "restart". + # + echo -n "Restarting $DESC: $NAME" + d_stop + sleep 1 + d_start + echo "." + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0