Not started WebUI

Discussion of the Web Interface for Transmission, formerly known as Clutch. This applies to all version of Transmission
Post Reply
glonium
Posts: 6
Joined: Sun Sep 29, 2013 7:48 am

Not started WebUI

Post by glonium »

Hello! I set the transmission-daemon on debian 7 reconfigured file settings.json included web interface. It worked! Reboot the system command "init 6" demon earned after the restart but the web interface is not looked port 9091 is closed. What's the problem? I'm sorry for my English!
glonium
Posts: 6
Joined: Sun Sep 29, 2013 7:48 am

Re: Not started WebUI

Post by glonium »

If you start the daemon with the command line / etc / init.d / transmission-daemon start a web interface is launched!
glonium
Posts: 6
Joined: Sun Sep 29, 2013 7:48 am

Re: Not started WebUI

Post by glonium »

log file:
[23:03:53.600] Transmission 2.52 (13304) started (session.c:718)
[23:03:53.600] Couldn't read "/var/lib/transmission-daemon/info/stats.json": No such file or directory (utils.c:445)
[23:03:53.600] Couldn't read "/var/lib/transmission-daemon/info/stats.benc": No such file or directory (utils.c:445)
[23:03:53.600] Cache Maximum cache size set to 4.00 MiB (256 blocks) (cache.c:249)
[23:03:53.600] RPC Server Adding address to whitelist: 127.0.0.* (rpc-server.c:803)
[23:03:53.600] RPC Server Adding address to whitelist: 192.168.1.* (rpc-server.c:803)
[23:03:53.600] RPC Server Serving RPC and Web requests on port 127.0.0.1:9091/transmission/ (rpc-server.c:997)
[23:03:53.600] getaddrinfo: address family for nodename not supported (trevent.c:218)
[23:03:53.600] RPC Server Whitelist enabled (rpc-server.c:1001)
[23:03:53.600] RPC Server Password required (rpc-server.c:1004)
[23:03:53.600] Bound socket 10 to port 51413 on 0.0.0.0 (net.c:371)
[23:03:53.600] Bound socket 11 to port 51413 on :: (net.c:371)
[23:03:53.600] Port Forwarding Stopped (port-forwarding.c:181)
[23:03:53.600] UDP Failed to set receive buffer: requested 4194304, got 262142 (tr-udp.c:75)
[23:03:53.600] UDP Please add the line "net.core.rmem_max = 4194304" to /etc/sysctl.conf (tr-udp.c:80)
[23:03:53.600] UDP Failed to set send buffer: requested 1048576, got 262142 (tr-udp.c:86)
[23:03:53.600] UDP Please add the line "net.core.wmem_max = 1048576" to /etc/sysctl.conf (tr-udp.c:91)
[23:03:53.600] DHT Initializing DHT (tr-dht.c:276)
[23:03:53.600] DHT Reusing old id (tr-dht.c:305)
[23:03:53.600] DHT Bootstrapping from 57 IPv4 nodes (tr-dht.c:153)
[23:03:53.600] DHT DHT initialized (tr-dht.c:330)
[23:03:53.600] Using settings from "/var/lib/transmission-daemon/info" (daemon.c:488)
[23:03:53.600] Saved "/etc/transmission-daemon/settings.json" (bencode.c:1731)
[23:03:53.600] transmission-daemon requiring authentication (daemon.c:508)
[23:10:20.756] DHT Finished bootstrapping (tr-dht.c:258)
killemov
Posts: 541
Joined: Sat Jul 31, 2010 5:04 pm

Re: Not started WebUI

Post by killemov »

glonium wrote:Hello! I set the transmission-daemon on debian 7 reconfigured file settings.json included web interface. It worked! Reboot the system command "init 6" demon earned after the restart but the web interface is not looked port 9091 is closed. What's the problem? I'm sorry for my English!
You probably need to add some symbolic links to make transmission start on reboot.

Code: Select all

cd /etc/rc2.d
ln -s ../init.d/tranmission-daemon S01transmission-daemon
cd /etc/rc0.d
ln -s ../init.d/tranmission-daemon K99transmission-daemon
Did you install the official debian package? I guess it should have added these links automatically.
glonium
Posts: 6
Joined: Sun Sep 29, 2013 7:48 am

Re: Not started WebUI

Post by glonium »

Write smal script daemon on python. this script started transmission-daemon after some time (200 sec), it's work!
glonium
Posts: 6
Joined: Sun Sep 29, 2013 7:48 am

Re: Not started WebUI

Post by glonium »

Code: Select all

#!/usr/bin/python

### BEGIN INIT INFO
# Provides:          my_daemon
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Example initscript
# Description:       This file should be used to construct scripts to be
#                    placed in /etc/init.d.
### END INIT INFO

#vars
log_path='/var/log/transmission_starter/'
delay_time=200
transmission_config_path='/etc/transmission-daemon/'
transmission_path='transmission-daemon'

import time
import os
import sys
import logging
import subprocess


logging.basicConfig(format = u'%(levelname)-8s [%(asctime)s] %(message)s', level = logging.DEBUG, filename = os.path.normpath(log_path+'transmission_starter.log'))

logging.info('script is started!')

class Daemon:
        """
        A generic daemon class.
       
        Usage: subclass the Daemon class and override the run() method
        """
        def __init__(self):
                self.stdin = '/dev/null'
                self.stdout = '/dev/null'
                self.stderr = '/dev/null'
                self.pidfile = '/dev/null'
       
        def daemonize(self):
                """
                do the UNIX double-fork magic, see Stevens' "Advanced
                Programming in the UNIX Environment" for details (ISBN 0201563177)
                http://www.erlenstar.demon.co.uk/unix/faq_2.html#SEC16
                """
                try:
                        pid = os.fork()
                        if pid > 0:
                                # exit first parent
                                sys.exit(0)
                except OSError, e:
			logging.critical('fork 1 is failed!')
                        sys.stderr.write("fork #1 failed: %d (%s)\n" % (e.errno, e.strerror))
                        sys.exit(1)
       
                # decouple from parent environment
                os.chdir("/")
                os.setsid()
                os.umask(0)
       
                # do second fork
                try:
                        pid = os.fork()
                        if pid > 0:
                                # exit from second parent
                                sys.exit(0)
                except OSError, e:
			logging.critical('fork 2 is failed!')
                        sys.stderr.write("fork #2 failed: %d (%s)\n" % (e.errno, e.strerror))
                        sys.exit(1)
       
                # redirect standard file descriptors
                sys.stdout.flush()
                sys.stderr.flush()
                si = file(self.stdin, 'r')
                so = file(self.stdout, 'a+')
                se = file(self.stderr, 'a+', 0)
                os.dup2(si.fileno(), sys.stdin.fileno())
                os.dup2(so.fileno(), sys.stdout.fileno())
                os.dup2(se.fileno(), sys.stderr.fileno())
               
        def start(self):
                """
                Start the daemon
                """
                # Start the daemon
                self.daemonize()
                self.run()
 
        def stop(self):
		logging.info('Stopping transmission-daemon')
		PIPE = subprocess.PIPE
		p = subprocess.Popen(['killall transmission-daemon'], shell=True, stdin=PIPE, stdout=PIPE,
     				   stderr=subprocess.STDOUT, close_fds=True, cwd='/home/')
		outmsg=p.stdout.read()		
		if (outmsg!='') :
			logging.warning('transmission not started!')
        def restart(self):
 		return
        def run(self):
		logging.info('Start delay')
		time.sleep(delay_time)
		logging.info('Delay is finished')
		logging.info('Startting transmission-daemon')
		PIPE = subprocess.PIPE
		p = subprocess.Popen([transmission_path+' -g '+transmission_config_path], shell=True, stdin=PIPE, stdout=PIPE,
     				   stderr=subprocess.STDOUT, close_fds=True, cwd='/home/')
		outmsg=p.stdout.read()		
		if (outmsg!='') :
			logging.warning(outmsg)

		


daemon = Daemon()
if len(sys.argv) == 2:
	if 'start' == sys.argv[1]:
		daemon.start()
	elif 'stop' == sys.argv[1]:
		daemon.stop()
	elif 'restart' == sys.argv[1]:
		daemon.restart()
	else:
		print "Unknown command"
		sys.exit(2)
	sys.exit(0)
else:
	print "usage: %s start|stop|restart" % sys.argv[0]
	sys.exit(2)

glonium
Posts: 6
Joined: Sun Sep 29, 2013 7:48 am

Re: Not started WebUI

Post by glonium »

What's daemons must started before transmission-daemon?
Post Reply