arch-pkgs/rtorrent-systemd/rtorrent.conf

104 lines
3.7 KiB
Plaintext

## Instance layout (base paths)
method.insert = cfg.basedir, private|const|string, (cat,"/var/lib/rtorrent/")
method.insert = cfg.logdir, private|const|string, (cat,"/var/log/rtorrent/")
method.insert = cfg.rundir, private|const|string, (cat,"/run/rtorrent/")
method.insert = cfg.confdir, private|const|string, (cat,"/etc/rtorrent/")
method.insert = cfg.conf_d, private|const|string, (cat, (cfg.confdir), "conf.d")
method.insert = cfg.download, private|const|string, (cat,(cfg.basedir),"download/")
method.insert = cfg.logfile, private|const|string, (cat,(cfg.logdir),"rtorrent.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 = sh, -c, (cat,\
"mkdir -p \"",(cfg.download),"\" ",\
"\"",(cfg.session),"\" ",\
"\"",(cfg.watch),"/load\" ",\
"\"",(cfg.watch),"/start\" ")
## Listening port for incoming peer traffic (fixed; you can also randomize it)
network.port_range.set = 50000-50000
network.port_random.set = no
## Tracker-less torrent and UDP tracker support
## (conservative settings for 'private' trackers, change for 'public')
dht.mode.set = disable
protocol.pex.set = no
trackers.use_udp.set = no
## Peer settings
throttle.max_uploads.set = 100
throttle.max_uploads.global.set = 250
throttle.min_peers.normal.set = 20
throttle.max_peers.normal.set = 60
throttle.min_peers.seed.set = 30
throttle.max_peers.seed.set = 80
trackers.numwant.set = 80
protocol.encryption.set = allow_incoming,try_outgoing,enable_retry
## Limits for file handle resources, this is optimized for
## an `ulimit` of 1024 (a common default). You MUST leave
## a ceiling of handles reserved for rTorrent's internal needs!
network.http.max_open.set = 50
network.max_open_files.set = 600
network.max_open_sockets.set = 300
## Memory resource usage (increase if you have a large number of items loaded,
## and/or the available resources to spend)
pieces.memory.max.set = 1800M
network.xmlrpc.size_limit.set = 20M
## Other operational settings (check & adapt)
session.path.set = (cat, (cfg.session))
directory.default.set = (cat, (cfg.download))
system.cwd.set = (directory.default)
encoding.add = utf8
system.umask.set = 0002
network.http.dns_cache_timeout.set = 25
schedule2 = monitor_diskspace, 15, 60, ((close_low_diskspace, 1000M))
## Some additional values and commands
method.insert = system.startup_time, value|const, (system.time)
method.insert = d.data_path, simple,\
"if=(d.is_multi_file),\
(cat, (d.directory), /),\
(cat, (d.directory), /, (d.name))"
method.insert = d.session_file, simple, "cat=(session.path), (d.hash), .torrent"
## Watch directories (add more as you like, but use unique schedule names)
## Add torrent
schedule2 = watch_load, 11, 10, ((load.verbose, (cat, (cfg.watch), "load/*.torrent")))
## Add & download straight away
schedule2 = watch_start, 10, 10, ((load.start_verbose, (cat, (cfg.watch), "start/*.torrent")))
## Run the rTorrent process as a daemon in the background
system.daemon.set = true
# create local socket for xmlrpc
network.scgi.open_local = (cat,(cfg.rundir),"rpc.sock")
execute.nothrow = chmod,770,(cat,(cfg.rundir),"rpc.sock")
## Logging:
## Levels = critical error warn notice info debug
## Groups = connection_* dht_* peer_* rpc_* storage_* thread_* tracker_* torrent_*
log.open_file = "log", (cfg.logfile)
log.add_output = "info", "log"
# also log execute.* commands
log.execute = (cat, (cfg.logdir), "execute.log")
# Load config fragments from conf.d
execute.nothrow = sh, -c, (cat,\
"find ", (cfg.conf_d), " -name '*.conf'",\
" | sort | sed -re 's/^/import=/' > ", (cfg.rundir), "import.conf")
try_import = (cat, (cfg.rundir), "import.conf")