From 93d024c52d4d0cc755667e7c2ecac86bae279fa3 Mon Sep 17 00:00:00 2001 From: David Runge Date: Fri, 20 Mar 2015 03:38:52 +0100 Subject: rtorrent.service: Adding a tmux systemd --user file that will launch a named tmux user session with rtorrent running, to attach to within a separate TMUX_TMPDIR set to the user's run directory. The user's Downloads directory will be used for a rtorrent tmp and session directory. --- user/rtorrent.service | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 user/rtorrent.service (limited to 'user') 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 -- cgit v1.2.3