Changing hostname prevents rtorrent from starting

Hello, sorry if I’m being a bit fik here, but I’ve noticed that changing the default hostname form DietPi to something else (hc2b in this case) upsets rtorrent. Here’s a working status output:

root@DietPi:~# systemctl status rtorrent
● rtorrent.service - rTorrent (DietPi)
Loaded: loaded (/etc/systemd/system/rtorrent.service; disabled; vendor preset: enabled)
Active: active (running) since Fri 2020-04-17 19:28:47 BST; 15s ago
Process: 818 ExecStart=/usr/bin/screen -fa -dmS rtorrent /usr/bin/rtorrent (code=exited, status=0/SUCCESS)
Main PID: 820 (screen)
CGroup: /system.slice/rtorrent.service
├─820 /usr/bin/SCREEN -fa -dmS rtorrent /usr/bin/rtorrent
└─821 /usr/bin/rtorrent

Apr 17 19:28:47 DietPi systemd[1]: Starting rTorrent (DietPi)…
Apr 17 19:28:47 DietPi systemd[1]: Started rTorrent (DietPi).

And here is what it says if I change hosty to hc2b:

root@hc2b:~# systemctl status rtorrent
● rtorrent.service - rTorrent (DietPi)
Loaded: loaded (/etc/systemd/system/rtorrent.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2020-04-17 19:27:29 BST; 2s ago
Process: 1011 ExecStop=/usr/bin/screen -S rtorrent -X quit (code=exited, status=1/FAILURE)
Process: 1006 ExecStart=/usr/bin/screen -fa -dmS rtorrent /usr/bin/rtorrent (code=exited, status=0/SUCCESS)
Main PID: 1007 (code=exited, status=0/SUCCESS)

Apr 17 19:27:29 hc2b systemd[1]: Starting rTorrent (DietPi)…
Apr 17 19:27:29 hc2b systemd[1]: Started rTorrent (DietPi).
Apr 17 19:27:29 hc2b systemd[1]: rtorrent.service: Control process exited, code=exited status=1
Apr 17 19:27:29 hc2b systemd[1]: rtorrent.service: Unit entered failed state.
Apr 17 19:27:29 hc2b systemd[1]: rtorrent.service: Failed with result ‘exit-code’.

I’ve looked around in .rtorrentrc but didn’t see anything that would cause this problem. I’ve rebooted several times, changed it via the dietpi-config screen, editing /etc/hostname and via the hostname command and get the same weirdness. The DietPi version is v6.28.0, and dpkg tells me rtorrent is 0.9.6-2+b1. Is the lock-down addling my brain?

Hi,

many thanks for your report. Did you had a look to the DietPi user guide?

https://dietpi.com/forum/t/dietpi-software-details-for-all-installation-options/22/70

I guess that’s the important section

Important note:
rTorrent creates a lock file based on the systems hostname. When the hostname is changed (e.g. via dietpi-config > Security Options), then the old lock file needs to be removed to allow rTorrent creating a new one based on the new hostname:

rm /mnt/dietpi_userdata/downloads/.session/rtorrent.lock
systemctl restart rtorrent

>

so pls stop rtorrent as follow and check if the .lock file is still there. If yes pls delete the .lock file.

```text
systemctl stop rtorrent

D’oh! Humble apologies and many thanks! It never occurred to me there would be hostname checks within the application. Yes, that lock file was the issue. I did look at journalctl but didn’t see anything mentioning this. I should have checked the application page anyway, sorry about that.

No problem. That’s why we at this board, to help if possible.