diff options
author | David Runge <dave@sleepmap.de> | 2015-03-20 03:38:52 +0100 |
---|---|---|
committer | David Runge <dave@sleepmap.de> | 2015-03-20 03:38:52 +0100 |
commit | 93d024c52d4d0cc755667e7c2ecac86bae279fa3 (patch) | |
tree | 2ab275b68d5556a26bf49ea01c7ddda8c530abc5 /user/rtorrent.service | |
parent | e81ad1c5c49ce00110daa6c651445064b30d5749 (diff) | |
download | uenv-93d024c52d4d0cc755667e7c2ecac86bae279fa3.tar.gz uenv-93d024c52d4d0cc755667e7c2ecac86bae279fa3.tar.bz2 uenv-93d024c52d4d0cc755667e7c2ecac86bae279fa3.tar.xz uenv-93d024c52d4d0cc755667e7c2ecac86bae279fa3.zip |
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.
Diffstat (limited to 'user/rtorrent.service')
-rw-r--r-- | user/rtorrent.service | 20 |
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 |