# Changing hostname prevents rtorrent from starting

**URL:** https://dietpi.com/forum/t/changing-hostname-prevents-rtorrent-from-starting/4016
**Category:** Troubleshooting
**Created:** [17 April 2020 18:41 UTC](https://dietpi.com/forum/t/changing-hostname-prevents-rtorrent-from-starting/4016 "2020-04-17T18:41:47Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![lammers](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/l/ed655f/32.png) [@lammers](https://dietpi.com/forum/u/lammers)
#### Post date: [17 April 2020 18:41 UTC](https://dietpi.com/forum/t/changing-hostname-prevents-rtorrent-from-starting/4016/1 "2020-04-17T18:41:47Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [17 April 2020 20:19 UTC](https://dietpi.com/forum/t/changing-hostname-prevents-rtorrent-from-starting/4016/2 "2020-04-17T20:19:42Z")

</div>

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](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:
> 
> ```auto
> 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.
> 
> ```auto
> systemctl stop rtorrent
> 
> ```

---

<div class="post-metadata">

### Author: ![lammers](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/l/ed655f/32.png) [@lammers](https://dietpi.com/forum/u/lammers)
#### Post date: [18 April 2020 12:21 UTC](https://dietpi.com/forum/t/changing-hostname-prevents-rtorrent-from-starting/4016/3 "2020-04-18T12:21:07Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [18 April 2020 13:45 UTC](https://dietpi.com/forum/t/changing-hostname-prevents-rtorrent-from-starting/4016/4 "2020-04-18T13:45:13Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Kou](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/k/f1d935/32.png) [@Kou](https://dietpi.com/forum/u/Kou)
#### Post date: [29 November 2022 22:29 UTC](https://dietpi.com/forum/t/changing-hostname-prevents-rtorrent-from-starting/4016/5 "2022-11-29T22:29:53Z")

</div>

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](https://thepihut.com/blogs/raspberry-pi-tutorials/19668676-renaming-your-raspberry-pi-the-hostname) 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.

---

<div class="post-metadata">

### Author: ![Jappe](https://dietpi.com/forum/user_avatar/dietpi.com/jappe/32/1788_2.png) [@Jappe](https://dietpi.com/forum/u/Jappe)
#### Post date: [29 November 2022 22:46 UTC](https://dietpi.com/forum/t/changing-hostname-prevents-rtorrent-from-starting/4016/6 "2022-11-29T22:46:54Z")

</div>

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.  
[https://dietpi.com/docs/software/bittorrent/#rtorrent](https://dietpi.com/docs/software/bittorrent/#rtorrent)

BTW which link isn’t working for you?

---

<div class="post-metadata">

### Author: ![Kou](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/k/f1d935/32.png) [@Kou](https://dietpi.com/forum/u/Kou)
#### Post date: [29 November 2022 22:53 UTC](https://dietpi.com/forum/t/changing-hostname-prevents-rtorrent-from-starting/4016/7 "2022-11-29T22:53:25Z")

</div>

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 " [https://dietpi.com/forum/t/dietpi-software-details-for-all-installation-options/22/70](https://dietpi.com/forum/t/dietpi-software-details-for-all-installation-options/22/70) "

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

---

<div class="post-metadata">

### Author: ![Jappe](https://dietpi.com/forum/user_avatar/dietpi.com/jappe/32/1788_2.png) [@Jappe](https://dietpi.com/forum/u/Jappe)
#### Post date: [29 November 2022 23:58 UTC](https://dietpi.com/forum/t/changing-hostname-prevents-rtorrent-from-starting/4016/8 "2022-11-29T23:58:27Z")

</div>

> [@Kou](#):
>
> The link in Joulinar’s post I replied to " [https://dietpi.com/forum/t/dietpi-software-details-for-all-installation-options/22/70](https://dietpi.com/forum/t/dietpi-software-details-for-all-installation-options/22/70) "
> 
> 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. 🙂

---

<div class="post-metadata">

### Author: ![Kou](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/k/f1d935/32.png) [@Kou](https://dietpi.com/forum/u/Kou)
#### Post date: [30 November 2022 00:15 UTC](https://dietpi.com/forum/t/changing-hostname-prevents-rtorrent-from-starting/4016/9 "2022-11-30T00:15:21Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [30 November 2022 07:02 UTC](https://dietpi.com/forum/t/changing-hostname-prevents-rtorrent-from-starting/4016/10 "2022-11-30T07:02:49Z")

</div>

Ok the old link has a deprecation warning as we moved all our docs to a new page [DietPi Documentation - DietPi.com Docs](http://dietpi.com/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?

---

<div class="post-metadata">

### Author: ![Kou](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/k/f1d935/32.png) [@Kou](https://dietpi.com/forum/u/Kou)
#### Post date: [30 November 2022 07:52 UTC](https://dietpi.com/forum/t/changing-hostname-prevents-rtorrent-from-starting/4016/11 "2022-11-30T07:52:41Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [30 November 2022 08:46 UTC](https://dietpi.com/forum/t/changing-hostname-prevents-rtorrent-from-starting/4016/12 "2022-11-30T08:46:24Z")

</div>

> [@Kou](#):
>
> From my research and finding this older post I thought this was a similar issue, but I was probably just doing something else wrong.

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 🙂
