Changing hostname prevents rtorrent from starting Topic is solved

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
lammers
Posts: 2
Joined: Fri Apr 17, 2020 8:31 pm

Changing hostname prevents rtorrent from starting

Post by lammers »

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?
User avatar
Joulinar
Posts: 2316
Joined: Sat Nov 16, 2019 12:49 am

Re: Changing hostname prevents rtorrent from starting

Post by Joulinar »

Hi,

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

viewtopic.php?p=2603#p2603

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:

Code: Select all

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.

Code: Select all

systemctl stop rtorrent
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
lammers
Posts: 2
Joined: Fri Apr 17, 2020 8:31 pm

Re: Changing hostname prevents rtorrent from starting

Post by lammers »

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.
User avatar
Joulinar
Posts: 2316
Joined: Sat Nov 16, 2019 12:49 am

Re: Changing hostname prevents rtorrent from starting

Post by Joulinar »

No problem. That's why we at this board, to help if possible.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply