Hi,
I've been using transmission on ClearOS (a CentOS derivative) for a while now (v1.92?) which I installed a while back using a standard user "transmission" with a home folder of /home/transmission. There is now an rpm for ClearOS using v2.22. The rpm uses a home of /var/lib/transmission and has an init script to use this home - here is a cut down version:
#!/bin/bash
# source function library
. /etc/rc.d/init.d/functions
# Defaults
TRANSMISSION_HOME="/var/lib/transmission"
DAEMON_ARGS="-b -t -a \"*.*.*.*\" -e /var/log/transmission/transmission.log"
# Configuration overrides
[ -e /etc/sysconfig/transmission-daemon ] && source /etc/sysconfig/transmission-daemon
# Daemon
NAME="transmission-daemon"
# Environment
DAEMON="/usr/bin/transmission-daemon"
DAEMON_USER="transmission"
DAEMON_PROCESS="transmission-daemon"
DAEMON_PIDFILE="/var/run/$NAME.pid"
DAEMON_LOCKFILE="/var/lock/subsys/$NAME"
[ -x "$DAEMON" ] || exit 0
PIDFILE="/var/run/$DAEMON_PROCESS.pid"
RETVAL=0
prog="transmission-daemon"
# See how we were called.
case "$1" in
start)
echo -n $"Starting $prog: "
if [ -n "$TRANSMISSION_HOME" ]; then
export TRANSMISSION_HOME
fi
daemon --check $DAEMON --user "$DAEMON_USER" --pidfile $PIDFILE $DAEMON $DAEMON_ARGS RETVAL=$?
if [ $RETVAL = 0 ]; then
touch $DAEMON_LOCKFILE
/sbin/pidof -o %PPID -x $NAME > $DAEMON_PIDFILE
fi
echo
;;
[snip]
exit $RETVAL
When this starts transmission-daemon the settings.json and other folders are created under /home/transmission and not /var/lib/transmission. It is like transmission is ignoring the setting of TRANSMISSION_HOME and using the home folder instead. Is this correct?
I know I can override it with the -g switch but I don't see that I should have to.
Transmission's default configuration file directory.
*
* The default configuration directory is determined this way:
* -# If the TRANSMISSION_HOME environment variable is set, its value is used.
* -# On Darwin, "${HOME}/Library/Application Support/${appname}" is used.
* -# On Windows, "${CSIDL_APPDATA}/${appname}" is used.
* -# If XDG_CONFIG_HOME is set, "${XDG_CONFIG_HOME}/${appname}" is used.
* -# ${HOME}/.config/${appname}" is used as a last resort.
# Username/password example
# DAEMON_ARGS="-b -t -a \"*.*.*.*\" -e /var/log/transmission/transmission.log"
# No username/password, but limited to 192.168.1.*
# DAEMON_ARGS="-b -T -a \"192.168.1.*\" -e /var/log/transmission/transmission.log"
Is the usage in the init script OK? It seems OK to me but I am relatively new to linux.
What you suggest is what I did while trying to track down the issue - stop transmission-daemon, delete settings.json, start transmission-daemon with the init script. A new settings.json was created in /home/transmission/.config/transmission-daemon rather than /var/lib/transmission/.config/transmission-daemon as I expected.
If it is a bug, does it have to be formally reported or is this thread good enough?
What is the difference of daemon on the script, and the usual start-stop-daemon which is what I use?
Does daemon pass the environment? even when changing users? (I'm not even sure this is true for start-stop-daemon) That is the main difference between Jordan's test and using the script shown.