[Unit] Description=rTorrent After=network.target auditd.service [Service] Type=forking ExecStart=/usr/bin/screen -d -m -fa -S rtorrent /usr/bin/rtorrent ExecStop=/bin/bash -c '/bin/kill -15 "$$(cat %h/.rtorrent.pid)"' ExecStop=/bin/bash -c 'while /bin/kill -0 "$$(cat %h/.rtorrent.pid)"; do /bin/sleep 0.1; done' ExecStopPost=bin/rm %h/.rtorrent.pid Restart=on-failure User=username WorkingDirectory=~ [Install] WantedBy=multi-user.target