# Launch as a daemon system.daemon.set = true # Instance layout method.insert = cfg.basedir, private|const|string, (cat,"/data/rtorrent/") method.insert = cfg.download, private|const|string, (cat,"/downloads/") # x rtorrent 0.9.8 #method.insert = cfg.download_complete, private|const|string, (cat,(cfg.download),"complete/") #method.insert = cfg.download_temp, private|const|string, (cat,(cfg.download),"temp/") method.insert = cfg.download_complete, (cat,(cfg.download)) method.insert = cfg.download_temp, (cat,(cfg.download)) method.insert = cfg.logs, private|const|string, (cat,(cfg.basedir),"log/") method.insert = cfg.session, private|const|string, (cat,(cfg.basedir),".session/") method.insert = cfg.watch, private|const|string, (cat,(cfg.basedir),"watch/") method.insert = cfg.rundir, private|const|string, (cat,"/var/run/rtorrent/") # Gets the full path of data of a torrent (it's a workaround for the possibly empty 'd.base_path' attribute) method.insert = d.data_path, simple, "if=(d.is_multi_file), (cat,(d.directory),/), (cat,(d.directory),/,(d.name))" # Default directory to save the downloaded torrents # x rtorrent 0.9.8 #directory.default.set = (cat,(cfg.download_temp)) directory.default.set = (cat,(cfg.download)) # Default session directory session.path.set = (cat,(cfg.session)) # PID file execute.nothrow = sh,-c,(cat,"echo >",(cfg.rundir),"rtorrent.pid"," ",(system.pid)) # SCGI socket and make it group-writable and secure network.scgi.open_local = (cat, (cfg.rundir), "scgi.socket") schedule2 = scgi_permission, 0, 0, (cat,"execute.nothrow=chmod,\"g+w,o=\",",(cfg.rundir),"scgi.socket") # Listening port for incoming peer traffic network.port_range.set = @RT_INC_PORT@-@RT_INC_PORT@ network.port_random.set = no # UDP port to use for DHT dht.port.set = @RT_DHT_PORT@ # XMLRPC size limit network.xmlrpc.size_limit.set = @XMLRPC_SIZE_LIMIT@ # Configure session saving interval to balance disk usage and torrent information accuracy schedule2 = session_save, 1200, @RT_SESSION_SAVE_SECONDS@, ((session.save)) # Save torrents immediately to prevent losing them between session saving intervals # Schedule task to run in background (with unique hash) to avoid seeding impact method.set_key = event.download.inserted_new, "schedule2 = ((d.hash)), 0, 0, ((d.save_full_session))" # Configure whether to delay tracker announces at startup # x rtorrent 0.9.8 #trackers.delay_scrape = @RT_TRACKER_DELAY_SCRAPE@ # Configure TCP rmem and wmem for rTorrent client network.send_buffer.size.set = @RT_SEND_BUFFER_SIZE@ network.receive_buffer.size.set = @RT_RECEIVE_BUFFER_SIZE@ # Configure preallocation feature for rTorrent client system.file.allocate.set = @RT_PREALLOCATE_TYPE@ # Logging ## levels = critical error warn notice info debug ## groups = connection_* dht_* peer_* rpc_* storage_* thread_* tracker_* torrent_* log.open_file = "log",(cat,(cfg.logs),"rtorrent.log") log.add_output = "@RT_LOG_LEVEL@","log" log.add_output = "rpc_events","log" #log.execute = (cat,(cfg.logs),"execute.log") #log.xmlrpc = (cat,(cfg.logs),"xmlrpc.log") # Initialize plugins execute2 = {sh,-c,/usr/bin/php83 /var/www/rutorrent/php/initplugins.php rtorrent &}