Config transmission-daemon

Ask for help and report issues not specific to either the Mac OS X or GTK+ versions of Transmission
Post Reply
madefka
Posts: 7
Joined: Sun Mar 01, 2009 11:51 am

Config transmission-daemon

Post by madefka »

Hi there,
I'm a pure newbie and I don't understand where I can configure transmission-daemon 'cause I don't find setting.json anywhere... I would like to set up the port and the user !

Regards.

ps: I am on debian lenny
rb07
Posts: 1400
Joined: Sun Aug 24, 2008 3:14 am

Re: Config transmission-daemon

Post by rb07 »

Have you read http://trac.transmissionbt.com/wiki/ConfigFiles ? and http://trac.transmissionbt.com/wiki/EditConfigFiles .

It all depends on how you start the daemon, perhaps the easiest way is to look at the processes with 'ps -ef | grep transmission' and in the first column see who is the owner, then go to that user's home directory and look for the .transmission directory or .config (like the above article says).

If that didn't work and you start it with an /etc/init.d/ script, then look at the script.

To set port and user there are 2 ways, one like you say is editing settings.jason (when the daemon is down), the other is to use parameters when you start the daemon.

In the Wiki there is http://trac.transmissionbt.com/wiki/Hea ... ge/General the init.d section answers one of your questions if you are using the sample script at http://trac.transmissionbt.com/wiki/Scr ... #StartStop, you can add further parameters, and both ports (remote control and peer) are available in the latest 1.5x series, un-comment TRANSMISSION_ARGS and use it, looking only at ports the defaults for instance are:

Code: Select all

TRANSMISSION_ARGS="-p 9091 -P 51413"
madefka
Posts: 7
Joined: Sun Mar 01, 2009 11:51 am

Re: Config transmission-daemon

Post by madefka »

Thanks for your help. I've already read your first links but it wasn't helpfull. When I run tranmission-daemon for the first time, it created these folders "blocklists", "daemon", "resume", "torrents" and the file "stats.benc" but there is not a settings.json... I try to launch the daemon with parameters but it doesn't work anyway... He is running but I can't use it with my remote...
rb07
Posts: 1400
Joined: Sun Aug 24, 2008 3:14 am

Re: Config transmission-daemon

Post by rb07 »

madefka wrote:... it created these folders "blocklists", "daemon", "resume", "torrents" and the file "stats.benc" but there is not a settings.json...
What version are you using?

With 1.51 (and all the recent ones since 1.34) I don't see a stats.benc or daemon; my config directory looks like this (I run it as user nobody):

Code: Select all

drwxr-xr-x 5 nobody nobody 4.0K Feb 27 15:58 ./
drwxr-xr-x 5 nobody nobody 4.0K Feb 12 13:14 ../
drwxr-xr-x 2 nobody nobody 4.0K Mar  1 02:12 blocklists/
drwxr-xr-x 2 nobody nobody 4.0K Feb 27 22:58 resume/
-rw-r--r-- 1 nobody nobody 1.2K Feb 27 16:02 settings.json
-rw-r--r-- 1 nobody nobody  156 Feb 27 16:02 stats.json
drwxr-xr-x 2 nobody nobody 4.0K Feb 27 22:58 torrents/
I try to launch the daemon with parameters but it doesn't work anyway... [He]It is running but I can't use it with my remote...
Remote? what does that mean?

Let's start from "launch the daemon", how? and are you sure there a no other transmission daemons running?

Settings.json is changed when the daemon stops... I'm not sure, but it may be created also when it stops. Changing anything while it is running won't do anything, also starting a 2nd copy with different parameters won't do anything.
guilherme
Posts: 51
Joined: Thu Jan 22, 2009 6:04 pm

Re: Config transmission-daemon

Post by guilherme »

If you're using Lenny's repository version, it's (as everything else) rather out dated (1.22 I think). IMO it would be worth compiling from source =)
madefka
Posts: 7
Joined: Sun Mar 01, 2009 11:51 am

Re: Config transmission-daemon

Post by madefka »

I'm using 1.22... :/
I'm sure there is only one daemon's running in the same time. I created a transmission user.

I launched it with the init.d script:

Code: Select all

#! /bin/sh
### BEGIN INIT INFO
# Provides:          transmission-daemon
# Required-Start:    networking
# Required-Stop:     networking
# Default-Start:     2 3 5
# Default-Stop:      0 1 6
# Short-Description: Start the transmission BitTorrent daemon client.
### END INIT INFO

# Original Author: Lennart A. JÃ.tte, based on Rob Howell's script
# Modified by Maarten Van Coile & others (on IRC)

# Do NOT "set -e"

#
# ----- CONFIGURATION -----
#
# For the default location Transmission uses, visit:
# http://trac.transmissionbt.com/wiki/ConfigFiles
# For a guide on how set the preferences, visit:
# http://trac.transmissionbt.com/wiki/EditConfigFiles
# For the available environement variables, visit:
# http://trac.transmissionbt.com/wiki/EnvironmentVariables
#
# The name of the user that should run Transmission.
# It's RECOMENDED to run Transmission in it's own user,
# by default, this is set to 'transmission'.
# For the sake of security you shouldn't set a password
# on this user
USERNAME=transmission


# ----- *ADVANCED* CONFIGURATION -----
# Only change these options if you know what you are doing!
#
# The folder where Transmission stores the config & web files.
# ONLY change this you have it at a non-default location
#TRANSMISSION_HOME="/var/config/transmission-daemon"
#TRANSMISSION_WEB_HOME="/usr/share/transmission/web"
#
# The arguments passed on to transmission-daemon.
# ONLY change this you need to, otherwise use the
# settings file as per above.
#TRANSMISSION_ARGS=""


# ----- END OF CONFIGURATION -----
#
# PATH should only include /usr/* if it runs after the mountnfs.sh script.
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
DESC="bittorrent client"
NAME=transmission-daemon
DAEMON=$(which $NAME)
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0

# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME

# Load the VERBOSE setting and other rcS variables
[ -f /etc/default/rcS ] && . /etc/default/rcS

#
# Function that starts the daemon/service
#

do_start()
{
    # Export the configuration/web directory, if set
    if [ -n "$TRANSMISSION_HOME" ]; then
          export TRANSMISSION_HOME
    fi
    if [ -n "$TRANSMISSION_WEB_HOME" ]; then
          export TRANSMISSION_WEB_HOME
    fi

    # Return
    #   0 if daemon has been started
    #   1 if daemon was already running
    #   2 if daemon could not be started
    start-stop-daemon --chuid $USERNAME --start --pidfile $PIDFILE --make-pidfile \
            --exec $DAEMON --background --test -- -f $TRANSMISSION_ARGS > /dev/null \
            || return 1
    start-stop-daemon --chuid $USERNAME --start --pidfile $PIDFILE --make-pidfile \
            --exec $DAEMON --background -- -f $TRANSMISSION_ARGS \
            || return 2
}

#
# Function that stops the daemon/service
#
do_stop()
{
        # Return
        #   0 if daemon has been stopped
        #   1 if daemon was already stopped
        #   2 if daemon could not be stopped
        #   other if a failure occurred
        start-stop-daemon --stop --quiet --retry=TERM/10/KILL/5 --pidfile $PIDFILE --name $NAME
        RETVAL="$?"
        [ "$RETVAL" = 2 ] && return 2

        # Wait for children to finish too if this is a daemon that forks
        # and if the daemon is only ever run from this initscript.
        # If the above conditions are not satisfied then add some other code
        # that waits for the process to drop all resources that could be
        # needed by services started subsequently.  A last resort is to
        # sleep for some time.

        start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
        [ "$?" = 2 ] && return 2

        # Many daemons don't delete their pidfiles when they exit.
        rm -f $PIDFILE

        return "$RETVAL"
}

case "$1" in
  start)
        echo "Starting $DESC" "$NAME..."
        do_start
        case "$?" in
                0|1) echo "   Starting $DESC $NAME succeeded" ;;
                *)   echo "   Starting $DESC $NAME failed" ;;
        esac
        ;;
  stop)
        echo "Stopping $DESC $NAME..."
        do_stop
        case "$?" in
                0|1) echo "   Stopping $DESC $NAME succeeded" ;;
                *)   echo "   Stopping $DESC $NAME failed" ;;
        esac
        ;;
  restart|force-reload)
        #
        # If the "reload" option is implemented then remove the
        # 'force-reload' alias
        #
        echo "Restarting $DESC $NAME..."
        do_stop
        case "$?" in
          0|1)
                do_start
                case "$?" in
                    0|1) echo "   Restarting $DESC $NAME succeeded" ;;
                    *)   echo "   Restarting $DESC $NAME failed: couldn't start $NAME" ;;
                esac
                ;;
          *)
                echo "   Restarting $DESC $NAME failed: couldn't stop $NAME" ;;
        esac
        ;;
  *)
        echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
        exit 3
        ;;
esac
Can I define a port for datas and another for my remote in my initd script ? I wanna use that gui remote .
Thank you so much...
rb07
Posts: 1400
Joined: Sun Aug 24, 2008 3:14 am

Re: Config transmission-daemon

Post by rb07 »

Transmission-remote-GUI doesn't work with that version, it needs 1.40 or newer.

The difference between versions is that 1.22 needed Clutch which is separate, from 1.34 upwards, RPC is embedded on the daemon.

As guilherme said, upgrade by building it yourself... or go for an unstable repository, which should have the newer versions. Or install Clutch (which needs Apache or lighttp) if you really want to keep the old version (if you are worried about performance, 1.34 and 1.51 work pretty well on small computers... I'm using 1.51 on a NAS, ARM@500MHz, 128 KB RAM).
madefka
Posts: 7
Joined: Sun Mar 01, 2009 11:51 am

Re: Config transmission-daemon

Post by madefka »

I think I'm such a newbie ! I will let it down 'cause I haven't the linux knowledge to make it work... Thanks for your help anyway ! :)
rb07
Posts: 1400
Joined: Sun Aug 24, 2008 3:14 am

Re: Config transmission-daemon

Post by rb07 »

We all had to learn, so don't worry too much, easiest way is using an unstable repository -- there should be a good guide or howto for the distro you are using.
madefka
Posts: 7
Joined: Sun Mar 01, 2009 11:51 am

Re: Config transmission-daemon

Post by madefka »

I installed a X11 forwarding SSH tunel, so now, I can use gtk, it is more easy for me to configure all these things ! I'm gonna try to compile the last version of Transmission ! I keep you in touch ! Thank for your support !
madefka
Posts: 7
Joined: Sun Mar 01, 2009 11:51 am

Re: Config transmission-daemon

Post by madefka »

It's me (again) ! I tried to compile the last version like I said before, but when I ./configure, I've got this error:

Code: Select all

checking for OPENSSL... checking for OpenSSL... configure: error: Cannot locate ssl
Any idea ? (OpenSSL installed by the way)
rb07
Posts: 1400
Joined: Sun Aug 24, 2008 3:14 am

Re: Config transmission-daemon

Post by rb07 »

If you installed OpenSSL from a package then you probably need to install also openssl-dev, which is another package.

Only openssl-dev leaves the pkg-config info needed by configure. You can check yourself, for instance with 'pkg-config --cflags openssl' .

Or, if openssl was installed manually then it may be just a question of where is it installed? in that case you have to add the path to the configure options, i.e. OPENSSL_CFLAGS=-I/opt/include OPENSSL_LIBS="-L/opt/lib -lssl -lcrypto -ldl" .
guilherme
Posts: 51
Joined: Thu Jan 22, 2009 6:04 pm

Re: Config transmission-daemon

Post by guilherme »

Code: Select all

# apt-get install libssl-dev
; )
madefka
Posts: 7
Joined: Sun Mar 01, 2009 11:51 am

Re: Config transmission-daemon

Post by madefka »

Thank youuuuuuu ! After few compilation's problems, it seems working !
It's so nice to meet people helpful like you !
Post Reply