OpenSuse 12 Transmission daemon & startup

Ask for help and report issues with the GTK+ version of Transmission
Post Reply
linkyone
Posts: 1
Joined: Wed Jul 25, 2012 4:47 pm

OpenSuse 12 Transmission daemon & startup

Post by linkyone »

I have OpenSuse 12 (CLI only) and Transmission installed (using Yast). I have a user (transmission) setup with the respective .config/transmission/settings.json file. I can run the application in the command line. I can run the transmission-daemon from the command line without and issue. My problem starts with getting the daemon to run on startup. I have tried using multiple init scripts (all placed in /etc/init.d) and registered to start in runlevel 3. Nothing seems to get it going. I do see a few errors in my message log:
transmission-daemon[4739]: /etc/init.d/transmission-daemon: line 13: .: /etc/sysconfig/network: is a directory
su: (to transmission) root on none
systemd-logind[731]: New user transmission logged in.
systemd-logind[731]: User transmission logged out.
transmission-daemon[4739]: Starting transmission-daemon: /etc/init.d/transmission-daemon: line 45: echo_failure: command not found
I've done my fair share of research on each and I must be honest, scripting is not my strong suit. From my assumptions, it looks like the errors logged are only warnings until it gets to the echo_failure command at which point it fails. When I run "systemctl status transmission-daemon.service" I get:

transmission-daemon.service - SYSV: Start up transmission-daemon
Loaded: loaded (/etc/init.d/transmission-daemon)
Active: active (exited) since Tue, 24 Jul 2012 20:37:35 +0200; 22h ago
CGroup: name=systemd:/system/transmission-daemon.service
Thoughts?

Here is my current init script:

Code: Select all

#!/bin/bash
#
# chkconfig: - 16 84
# description: Start up transmission-daemon
#
# processname: transmission-daemon
# config: /etc/sysconfig/transmission

# source function library
. /etc/rc.status

# Get network config
. /etc/sysconfig/network

[ "${NETWORKING}" = "no" ] && exit 0

# Defaults
TRANSMISSION_HOME=/var/lib/transmission

DAEMON_USER="transmission"
DAEMON_ARGS="-T --blocklist -g $TRANSMISSION_HOME/.config/transmission"

# Daemon
NAME=transmission-daemon

DAEMON=$(which $NAME)
DAEMON_PIDFILE=/var/run/$NAME.pid
DAEMON_LOCKFILE=/var/lock/subsys/$NAME
DAEMON_SCRIPTNAME=/etc/init.d/$NAME
DAEMON_LOGFILE=/var/log/$NAME.log

[ -x "$DAEMON" ] || exit 0

start() {
    echo -n $"Starting ${NAME}: "
    
    if [ -n "$TRANSMISSION_HOME" ]; then
        export TRANSMISSION_HOME
    fi

    su - $DAEMON_USER -c "$DAEMON $DAEMON_ARGS"

    sleep 2

    status $NAME &> /dev/null && echo_success || echo_failure
    RETVAL=$?

    if [ $RETVAL -eq 0 ]; then
        touch $DAEMON_LOCKFILE
        pidof -o %PPID -x $NAME > $DAEMON_PIDFILE
    fi

    echo
}

stop() {
    echo -n $"Shutting down ${NAME}: "
    
    killproc $NAME
    RETVAL=$?

    [ $RETVAL -eq 0 ] && /bin/rm -f $DAEMON_LOCKFILE $DAEMON_PIDFILE

    echo
}

case "$1" in
    start)
        start
    ;;
    stop)
        stop
    ;;
    restart)
        stop
        start
    ;;
    status)
        status $NAME
    ;;

    *)
        echo "Usage: $SCRIPTNAME {start|stop|restart|status}" >&2
        exit 3
    ;;
esac
Post Reply