From d9d0a30417e5c96f0dbf272a5445474bbb9f6945 Mon Sep 17 00:00:00 2001 From: g0tmi1k Date: Mon, 4 Jun 2018 11:40:02 +0100 Subject: [PATCH] Add variable paths and daemon option --- CONFIG-Template.md | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/CONFIG-Template.md b/CONFIG-Template.md index daac76e..535e4db 100644 --- a/CONFIG-Template.md +++ b/CONFIG-Template.md @@ -46,15 +46,20 @@ from files in a ``config.d`` directory. ############################################################################# # Instance layout (base paths) -method.insert = cfg.basedir, private|const|string, (cat,"/home/USERNAME/rtorrent/") -method.insert = cfg.watch, private|const|string, (cat,(cfg.basedir),"watch/") -method.insert = cfg.logs, private|const|string, (cat,(cfg.basedir),"log/") -method.insert = cfg.logfile, private|const|string, (cat,(cfg.logs),"rtorrent-",(system.time),".log") +method.insert = cfg.basedir, private|const|string, (cat,"/rtorrent/") +method.insert = cfg.download, private|const|string, (cat,(cfg.basedir),"download/") +method.insert = cfg.logs, private|const|string, (cat,(cfg.basedir),"log/") +method.insert = cfg.logfile, private|const|string, (cat,(cfg.logs),"rtorrent-",(system.time),".log") +method.insert = cfg.session, private|const|string, (cat,(cfg.basedir),".session/") +method.insert = cfg.watch, private|const|string, (cat,(cfg.basedir),"watch/") # Create instance directories execute.throw = bash, -c, (cat,\ "builtin cd \"", (cfg.basedir), "\" ",\ - "&& mkdir -p .session download log watch/{load,start}") + "&& mkdir -p \"",(cfg.download),"\" ",\ + "\"",(cfg.logs),"\" ",\ + "\"",(cfg.session),"\" ",\ + "\"",(cfg.watch),"\"/{load,start}") # Listening port for incoming peer traffic (fixed; you can also randomize it) network.port_range.set = 50000-50000 @@ -91,8 +96,8 @@ pieces.memory.max.set = 1800M network.xmlrpc.size_limit.set = 4M # Basic operational settings (no need to change these) -session.path.set = (cat, (cfg.basedir), ".session/") -directory.default.set = (cat, (cfg.basedir), "download/") +session.path.set = (cat, (cfg.session)) +directory.default.set = (cat, (cfg.download)) log.execute = (cat, (cfg.logs), "execute.log") ##log.xmlrpc = (cat, (cfg.logs), "xmlrpc.log") execute.nothrow = bash, -c, (cat, "echo >",\ @@ -124,6 +129,12 @@ method.insert = d.session_file, simple, "cat=(session.path), (d.hash), .torrent" schedule2 = watch_start, 10, 10, ((load.start_verbose, (cat, (cfg.watch), "start/*.torrent"))) schedule2 = watch_load, 11, 10, ((load.verbose, (cat, (cfg.watch), "load/*.torrent"))) +# Run the rTorrent process as a daemon in the background +# (and control via XMLRPC sockets) +#system.daemon.set = true +#network.scgi.open_local = (cat,(session.path),rtorrent.sock) +#execute.nothrow = chmod,770,(cat,(session.path),rtorrent.sock) + # Logging: # Levels = critical error warn notice info debug # Groups = connection_* dht_* peer_* rpc_* storage_* thread_* tracker_* torrent_*