[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=%t/tmux ExecStartPre=/usr/bin/mkdir -p $TMUX_TMPDIR 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