From 63b207944e4af58ddd000aaafe3c2d65efb67163 Mon Sep 17 00:00:00 2001 From: Qnd Date: Fri, 16 Sep 2016 12:02:55 +0900 Subject: [PATCH] added the systemd startup information for a new Ubuntu 16.04 system --- Common-Tasks-in-rTorrent.rest | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/Common-Tasks-in-rTorrent.rest b/Common-Tasks-in-rTorrent.rest index d33907a..f138034 100644 --- a/Common-Tasks-in-rTorrent.rest +++ b/Common-Tasks-in-rTorrent.rest @@ -281,3 +281,38 @@ Assuming a Gentoo distribution, and having the **daemon** USE flag enabled ; sel .. code-block:: # rc-update add rtorrentd default + +Ubuntu 16.04 (with systemd) +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Older systems will use the service command with screen to utilise a startup file, typically located in (or symlinked to) /etc/init.d/ however the new systemctl command requires a different format. + +Make sure you have tmux installed (tmux instead of screen): + +.. code-block:: + + $ sudo atp-get update; sudo apt-get install tmux + +Create the following file: + +.. code-block:: + + [Unit] + Description=rtorrent (in tmux) + + [Service] + Type=oneshot + RemainAfterExit=yes + User=YOUR_USER_ID_WHICH_RUNS_RTORRENT_GOES_HERE + ExecStart=/usr/bin/tmux -2 new-session -d -s rtorrent rtorrent + ExecStop=/usr/bin/tmux kill-session -t rtorrent + + [Install] + WantedBy=default.target + +After that, you will need to then enable and start the service: + +.. code-block:: + + $ sudo systemctl enable rtorrent.service + $ sudo systemctl start rtorrent.service \ No newline at end of file