diff --git a/states/roles/maintain/rtorrent/rtorrent.service b/states/roles/maintain/rtorrent/rtorrent.service index 3c890a2..e9198d9 100644 --- a/states/roles/maintain/rtorrent/rtorrent.service +++ b/states/roles/maintain/rtorrent/rtorrent.service @@ -5,13 +5,14 @@ [Service] User=root - Type=forking + Type=notify KillMode=none ExecStartPre=/usr/bin/bash -c 'if test -e /mnt/video/rtorrent/.session/rtorrent.lock && test -z `pidof rtorrent`; then rm -f /mnt/video/rtorrent/.session/rtorrent.lock; fi' ExecStart=/bin/bash -c 'sleep 10;/usr/bin/screen -dmfa -S rtorrent /usr/bin/rtorrent -b `ifconfig tun0 | grep "inet " | grep -Po "(?<=inet).*(?=net)"`' ExecStop=/usr/bin/bash -c "test `pidof rtorrent` && killall -w -s 2 /usr/bin/rtorrent" WorkingDirectory=/mnt/video/rtorrent - Restart=on-failure + WatchdogSec=420 + Restart=always [Install] WantedBy=default.target \ No newline at end of file