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?


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

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.

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.

The link here no longer works, but would this still be the way to do it with newer versions? Without the link due to your quoted parts I think I understand even with my lack of knowledge of Linux that I need to figure out how to stop rtorrent and delete the file if I want to change the host name assuming this has not changed?

I tried to change it based on the commands in this Pihut Guide just editing two files in nano and then when I rebooted with sudo reboot I could not get it to come back online. Now I decided to redo it all and I still would like to change hostname, but I am afraid of breaking it again.

Hello @Kou and welcome to the forum!

I assume this is still necessary since the note is still in the docs. And the commands are still the same like in Joulinars post.

BTW which link isn’t working for you?

Thank you! I normally don’t make accounts or posts but I am hoping to better get a grasp on all of this. I will check that out!

The link in Joulinar’s post I replied to " "

It says " Oops! That page doesn’t exist or is private."

Oh okay, now I understand. I still can see it, as a moderator. I think this was the old “documentation” and it’s still in the forum as reference, but only visible to mods and admins. It was created before I joined here so I was wondering what you were talking about, but now it makes sense to me. :slight_smile:

Ah got it makes sense then haha

If you don’t mind an additional question, if I do not plan to use BitTorrent/rTorrent because I am using dietpi for setting up only a pihole can I just remove it altogether to simplify changing the hostname or is it best to leave it in place?

Ok the old link has a deprecation warning as we moved all our docs to a new page DietPi Documentation - Docs

Just for my understanding. What exactly you are trying to do? Using rTorrent? No?

Just changing the host name should be possible using dietpi-config.

Or do I misunderstood the issue?

Apologies, I am so bad at this I am the one confusing things.

I only wanted to change the hostname but had an issue where my Pi would not come back after reboot after the change. From my research and finding this older post I thought this was a similar issue, but I was probably just doing something else wrong. The dietpi-config suggestion worked thank you so much and sorry for the trouble on an old post.

All good. In case of such old post, it might be better to start a new one next time. Just to avoid misunderstandings or confusion :slight_smile: