NSLU2-Linux
view · edit · print · history

CTorrent Control Server (CTCS) is an interface for monitoring and managing Enhanced CTorrent clients. It can manage allocation of bandwidth, provide status information, and allow changes to the running configuration of each client. Communication with CTorrent is via a TCP connection, and the user interface is a web browser.

CTCS was developed by Daniel Holmes, the creator of Enhanced CTorrent. The original sources are available at http://www.rahul.net/dholmes/ctorrent/ctcs.html.

The current version available for Optware is 1.4.1.

Installation

If you want to install it, just update the list of packages available for ipkg and then install it:

ipkg update
ipkg install ctcs

Init script

The package for the nslu2 includes a init script that starts CTCS when the slug boots. It is located at /opt/etc/init.d/S90ctcs. If you want to change any command line option, you can change the script and restart it.

The script starts CTCS in the background using the default port (2780) and redirects all output to /dev/null. CTCS writes messages to the console, something unappropriate for a server running in the background. If you want to log the output, then change the destination at the init script.

If you upgrade to the latest version of CTCS and you have edited your init script, ipkg will warn you about the changed file with a message like this:

Installing ctcs (1.3-8) to root...
    Configuration file '/opt/etc/ctcs.conf'
    ==> File on system created by you or by a script.
    ==> File also in package provided by package maintainer.
       What would you like to do about it ?  Your options are:
        Y or I  : install the package maintainer's version
        N or O  : keep your currently-installed version
          D     : show the differences between the versions (if diff is installed)
     The default action is to keep your current version.
    *** ctcs.conf (Y/I/N/O/D) [default=N] ?

Since the command line options have not changed in version 1.2, you can safely keep your modified file by answering "N" or "O".

Command line options

ctcs [-d <dlimit>] [-u <ulimit>] [-i <interval>] [-p <port>] [-P]

-d dlimit
    Overall download bandwidth limit, in KB/s (default 100). 

-u ulimit
    Overall upload bandwidth limit, in KB/s (default 25). Use a value 
    that is less than the maximum capacity of your network line. 

-i interval
    Bandwidth management change interval, in seconds (default 5). The 
    recommended minimum value is 3. Higher values will reduce 
    oscillation of individual torrent limits, but a value that is too 
    high will cause very slow reactions to changes in bandwidth usage. 

-p port
    The TCP port on which to listen for connections (default 2780). 

-P
    Prompt for an authorization password. 

Security

CTCS has an option ("-P") to prompt for a password when the server starts. This password is then used to authenticate Enhanced CTorrent clients, but not for web browser authentication. If you are using the init script provided by the package, you will not be able to use this option, since CTCS will be started from the init script with no user intervention.

Using Enhanced CTorrent with CTCS

When you start Enhanced CTorrent, the -S option tells it to use CTCS. An example is given in the Enhanced CTorrent page.

Known issues

These are the known issues, as of August 13, 2006:

  • CTCS has only been tested on the NSLU2, but since it is just a Perl script, chances are it will work fine in other platforms. Testers are welcomed.
  • There is a problem that causes the server to quit unexpectedly sometimes. This should not happen after a fix introduced in version 1.1-5, but there are some reports of this problem still showing up. I believe there is an issue with the re-use of port numbers by other processes in the slug, mainly the ctorrent clients.
    A simple measure to avoid this problem is to run CTCS on a reserved port. Any unused port number below 1024 should work, in my case I'm using port 980. You'll need to edit /opt/etc/ctcs.conf, changing ctcs_port to the new number and also adjust the -S parameter used in the command line to enhanced-ctorrent.
view · edit · print · history · Last edited by fcarolo.
Based on work by fcarolo and fishead.
Originally by fcarolo.
Page last modified on August 07, 2008, at 03:38 PM