aboutsummaryrefslogtreecommitdiffstats
path: root/user/rtorrent.service
diff options
context:
space:
mode:
Diffstat (limited to 'user/rtorrent.service')
-rw-r--r--user/rtorrent.service20
1 files changed, 20 insertions, 0 deletions
diff --git a/user/rtorrent.service b/user/rtorrent.service
new file mode 100644
index 0000000..1234407
--- /dev/null
+++ b/user/rtorrent.service
@@ -0,0 +1,20 @@
+[Unit]
+Description=rTorrent
+After=network.target local-fs.target
+ConditionFileIsExecutable=/usr/bin/tmux
+ConditionFileIsExecutable=/usr/bin/rtorrent
+
+
+[Service]
+Type=forking
+KillMode=none
+Environment=TMUX_TMPDIR=/run/user/%U/tmux
+ExecStartPre=/usr/bin/mkdir -p /home/%u/Downloads/rtorrent/tmp
+ExecStartPre=/usr/bin/mkdir -p /home/%u/Downloads/rtorrent/session
+ExecStart=/usr/bin/tmux -L rt new-session -s rt -n rtorrent -d rtorrent
+ExecStop=/usr/bin/tmux -L rt send-keys -t rt:rtorrent C-q
+WorkingDirectory=/home/%u/Downloads
+Restart=on-failure
+
+[Install]
+WantedBy=default.target