On partira du principe que le dossier où se trouve rtorrent est
/home/rtorrent
et que l'user est rtorrent
On commence par créer le fichier suivant /etc/systemd/system/rtorrent@.service
[Unit]
Description= Daemon Rtorrent
After=network.target
[Service]
Type=simple
User=rtorrent
Group=rtorrent
WorkingDirectory=/home/rtorrent
# Modify the next line to the absolute path for rtorrent.lock, for exemple
ExecStartPre=-/bin/rm -f /home/rtorrent/.session/rtorrent.lock
ExecStart=/usr/bin/rtorrent -o system.daemon.set=true
Restart=on-failure
RestartSec=3
[Install]
WantedBy=multi-user.target
Ensuite on active le tout :
systemctl enable rtorrent@user
Puis
systemctl start rtorrent@user
Et si vous voulez l'arreter
systemctl stop rtorrent@user