# CentOS 9 Tor relay setup keeps getting this error

**URL:** https://forum.torproject.org/t/centos-9-tor-relay-setup-keeps-getting-this-error/12321
**Category:** Relay Operator
**Tags:** tor
**Created:** [April 15, 2024, 8:57am UTC](https://forum.torproject.org/t/centos-9-tor-relay-setup-keeps-getting-this-error/12321 "2024-04-15T08:57:56Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![redacted4ever](https://forum.torproject.org/letter_avatar_proxy/v4/letter/r/7ba0ec/32.png) [@redacted4ever](https://forum.torproject.org/u/redacted4ever)
#### Post date: [April 15, 2024, 8:57am UTC](https://forum.torproject.org/t/centos-9-tor-relay-setup-keeps-getting-this-error/12321/1 "2024-04-15T08:57:56Z")

</div>

So on CentOS 9 im trying to set up a relay, but whenever i try to start/restart tor it results in an error. I tried to find solutions online, but couldn’t find any. Here’s the logs from journalctl -xeu tor.service

**Subject: Unit failed**  
**Defined-By: systemd**  
**Support: [Red Hat Customer Experience & Engagement - Red Hat Customer Portal](https://access.redhat.com/support)**

**The unit tor.service has entered the ‘failed’ state with result ‘exit-code’.**  
**Apr 14 19:46:40 ip-172-26-6-114.ap-northeast-1.compute.internal systemd[1]: Failed to start Anonymizing overlay network for TCP.**  
**Subject: A start job for unit tor.service has failed**  
**Defined-By: systemd**  
**Support: [Red Hat Customer Experience & Engagement - Red Hat Customer Portal](https://access.redhat.com/support)**

**A start job for unit tor.service has finished with a failure.**  
**The job identifier is 1734 and the job result is failed.**  
**Apr 14 19:46:41 ip-172-26-6-114.ap-northeast-1.compute.internal systemd[1]: tor.service: Scheduled restart job, restart counter is at 5.**  
**Subject: Automatic restarting of a unit has been scheduled**  
**Defined-By: systemd**  
**Support: [Red Hat Customer Experience & Engagement - Red Hat Customer Portal](https://access.redhat.com/support)**

**Automatic restarting of the unit tor.service has been scheduled, as the result for the configured Restart= setting for the unit.**  
**Apr 14 19:46:41 ip-172-26-6-114.ap-northeast-1.compute.internal systemd[1]: Stopped Anonymizing overlay network for TCP.**  
**Subject: A stop job for unit tor.service has finished**  
**Defined-By: systemd**  
**Support: [Red Hat Customer Experience & Engagement - Red Hat Customer Portal](https://access.redhat.com/support)**

**A stop job for unit tor.service has finished.**  
**The job identifier is 1797 and the job result is done.**  
**Apr 14 19:46:41 ip-172-26-6-114.ap-northeast-1.compute.internal systemd[1]: tor.service: Start request repeated too quickly.**  
**Apr 14 19:46:41 ip-172-26-6-114.ap-northeast-1.compute.internal systemd[1]: tor.service: Failed with result ‘exit-code’.**  
**Subject: Unit failed**  
**Defined-By: systemd**  
**Support: [Red Hat Customer Experience & Engagement - Red Hat Customer Portal](https://access.redhat.com/support)**

**The unit tor.service has entered the ‘failed’ state with result ‘exit-code’.**  
**Apr 14 19:46:41 ip-172-26-6-114.ap-northeast-1.compute.internal systemd[1]: Failed to start Anonymizing overlay network for TCP.**  
**Subject: A start job for unit tor.service has failed**  
**Defined-By: systemd**  
**Support: [Red Hat Customer Experience & Engagement - Red Hat Customer Portal](https://access.redhat.com/support)**

**A start job for unit tor.service has finished with a failure.**  
**The job identifier is 1797 and the job result is failed.**

---

<div class="post-metadata">

### Author: ![capole](https://forum.torproject.org/letter_avatar_proxy/v4/letter/c/f6c823/32.png) [@capole](https://forum.torproject.org/u/capole)
#### Post date: [April 15, 2024, 10:23am UTC](https://forum.torproject.org/t/centos-9-tor-relay-setup-keeps-getting-this-error/12321/2 "2024-04-15T10:23:57Z")

</div>

Whenever I got this problem in the past (doesn’t matter the OS) it had to do with the `torrc` config file. If I had to bet on it, I’d say it is some bad config or typo.

Kindly share your configuration here (censor any information you may consider relevant for you).

If `torrc` is fine, the next thing I’d check are directory and files permissions.

---

<div class="post-metadata">

### Author: ![redacted4ever](https://forum.torproject.org/letter_avatar_proxy/v4/letter/r/7ba0ec/32.png) [@redacted4ever](https://forum.torproject.org/u/redacted4ever)
#### Post date: [April 15, 2024, 10:48am UTC](https://forum.torproject.org/t/centos-9-tor-relay-setup-keeps-getting-this-error/12321/3 "2024-04-15T10:48:41Z")

</div>

```auto
Nickname [thename]
ORPort 443
ContactInfo [myemail]
SocksPort 0
ExitRelay 0
ControlPort 5009

```

> **···**
>
> On Mon, Apr 15, 2024 at 4:04 PM capole via Tor Project Forum \<[noreply@forum.torproject.org](mailto:noreply@forum.torproject.org)\> wrote:
> 
> > > ![](https://forum.torproject.org/letter_avatar_proxy/v4/letter/c/f6c823/45.png "capole") | [capole](https://forum.torproject.org/u/capole)  
> > > April 15 |
> > > 
> > > - | - |
> > 
> > Whenever I got this problem in the past (doesn’t matter the OS) it had to do with the `torrc` config file. If I had to bet on it, I’d say it is some bad config or typo.
> > 
> > Kindly share your configuration here (censor any information you may consider relevant for you).
> > 
> > If `torrc` is fine, the next thing I’d check are directory and files permissions.
> > 
> > * * *
> > 
> > [Visit Topic](https://forum.torproject.org/t/centos-9-tor-relay-setup-keeps-getting-this-error/12321/2) or reply to this email to respond.
> > 
> > To unsubscribe from these emails, [click here](https://forum.torproject.org/email/unsubscribe/f8324bd24e1e65defbb032e46c4c38f4d842cffc4cf0b5695ae4c8df8d63dc62).

---

<div class="post-metadata">

### Author: ![redacted4ever](https://forum.torproject.org/letter_avatar_proxy/v4/letter/r/7ba0ec/32.png) [@redacted4ever](https://forum.torproject.org/u/redacted4ever)
#### Post date: [April 15, 2024, 10:52am UTC](https://forum.torproject.org/t/centos-9-tor-relay-setup-keeps-getting-this-error/12321/4 "2024-04-15T10:52:44Z")

</div>

Also, this same error came even when I tried in fedora and rhel

> **···**
>
> On Mon, Apr 15, 2024 at 4:17 PM Redacted4ever-2 \<[serveroverseercouncil@gmail.com](mailto:serveroverseercouncil@gmail.com)\> wrote:
> 
> > Nickname [thename]  
> > ORPort 443  
> > ContactInfo [myemail]  
> > SocksPort 0  
> > ExitRelay 0  
> > ControlPort 5009
> > 
> > On Mon, Apr 15, 2024 at 4:04 PM capole via Tor Project Forum \<[noreply@forum.torproject.org](mailto:noreply@forum.torproject.org)\> wrote:
> > 
> > > > ![](https://forum.torproject.org/letter_avatar_proxy/v4/letter/c/f6c823/45.png "capole") | [capole](https://forum.torproject.org/u/capole)  
> > > > April 15 |
> > > > 
> > > > - | - |
> > > 
> > > Whenever I got this problem in the past (doesn’t matter the OS) it had to do with the `torrc` config file. If I had to bet on it, I’d say it is some bad config or typo.
> > > 
> > > Kindly share your configuration here (censor any information you may consider relevant for you).
> > > 
> > > If `torrc` is fine, the next thing I’d check are directory and files permissions.
> > > 
> > > * * *
> > > 
> > > [Visit Topic](https://forum.torproject.org/t/centos-9-tor-relay-setup-keeps-getting-this-error/12321/2) or reply to this email to respond.
> > > 
> > > To unsubscribe from these emails, [click here](https://forum.torproject.org/email/unsubscribe/f8324bd24e1e65defbb032e46c4c38f4d842cffc4cf0b5695ae4c8df8d63dc62).

---

<div class="post-metadata">

### Author: ![sunshinecowboy](https://forum.torproject.org/user_avatar/forum.torproject.org/sunshinecowboy/32/4558_2.png) [@sunshinecowboy](https://forum.torproject.org/u/sunshinecowboy)
#### Post date: [April 15, 2024, 3:15pm UTC](https://forum.torproject.org/t/centos-9-tor-relay-setup-keeps-getting-this-error/12321/5 "2024-04-15T15:15:06Z")

</div>

It may be that the ORPort is not open. Check if you have a firewall blocking the ORPort. Additionally, if you will post the contents of the following: cat /var/log/syslog | grep ‘Tor’

---

<div class="post-metadata">

### Author: ![redacted4ever](https://forum.torproject.org/letter_avatar_proxy/v4/letter/r/7ba0ec/32.png) [@redacted4ever](https://forum.torproject.org/u/redacted4ever)
#### Post date: [April 15, 2024, 5:28pm UTC](https://forum.torproject.org/t/centos-9-tor-relay-setup-keeps-getting-this-error/12321/6 "2024-04-15T17:28:52Z")

</div>

I checked the firewall, port 443 is open. And when i ran cat /var/log/syslog | grep ‘Tor’ it just says cat: /var/log/syslog: No such file or directory

> **···**
>
> On Mon, Apr 15, 2024 at 8:55 PM Sunshinecowboy via Tor Project Forum \<[noreply@forum.torproject.org](mailto:noreply@forum.torproject.org)\> wrote:
> 
> > > ![](https://forum.torproject.org/user_avatar/forum.torproject.org/sunshinecowboy/45/4558_2.png "sunshinecowboy") | [sunshinecowboy](https://forum.torproject.org/u/sunshinecowboy)  
> > > April 15 |
> > > 
> > > - | - |
> > 
> > It may be that the ORPort is not open. Check if you have a firewall blocking the ORPort. Additionally, if you will post the contents of the following: cat /var/log/syslog | grep ‘Tor’
> > 
> > * * *
> > 
> > [Visit Topic](https://forum.torproject.org/t/centos-9-tor-relay-setup-keeps-getting-this-error/12321/5) or reply to this email to respond.
> > 
> > To unsubscribe from these emails, [click here](https://forum.torproject.org/email/unsubscribe/ee73df1899f8de3b91ebdd64738b80c0e7db1e6b238fd44692d7cbc79037736c).

---

<div class="post-metadata">

### Author: ![redacted4ever](https://forum.torproject.org/letter_avatar_proxy/v4/letter/r/7ba0ec/32.png) [@redacted4ever](https://forum.torproject.org/u/redacted4ever)
#### Post date: [April 15, 2024, 5:28pm UTC](https://forum.torproject.org/t/centos-9-tor-relay-setup-keeps-getting-this-error/12321/7 "2024-04-15T17:28:58Z")

</div>

The journalctl logs were a bit different this time, I think this might be the issue, I don’t know for sure.

 ![image](https://forum.torproject.org/uploads/default/original/2X/e/e99b9ba15dcdd9628f7130359dd8dd40ffbcdee4.png)

---

<div class="post-metadata">

### Author: ![sunshinecowboy](https://forum.torproject.org/user_avatar/forum.torproject.org/sunshinecowboy/32/4558_2.png) [@sunshinecowboy](https://forum.torproject.org/u/sunshinecowboy)
#### Post date: [April 16, 2024, 1:25am UTC](https://forum.torproject.org/t/centos-9-tor-relay-setup-keeps-getting-this-error/12321/8 "2024-04-16T01:25:52Z")

</div>

Ahhh, it looks like your user permissions aren’t set correctly. So We can confirm this is the issue, can you paste the contents of /var/log/Tor/log ?

---

<div class="post-metadata">

### Author: ![redacted4ever](https://forum.torproject.org/letter_avatar_proxy/v4/letter/r/7ba0ec/32.png) [@redacted4ever](https://forum.torproject.org/u/redacted4ever)
#### Post date: [April 16, 2024, 2:48am UTC](https://forum.torproject.org/t/centos-9-tor-relay-setup-keeps-getting-this-error/12321/9 "2024-04-16T02:48:28Z")

</div>

> [@sunshinecowboy](#):
>
> /var/log/Tor/log

/var/log does not exist.  
Log folder does not exist.

---

<div class="post-metadata">

### Author: ![sunshinecowboy](https://forum.torproject.org/user_avatar/forum.torproject.org/sunshinecowboy/32/4558_2.png) [@sunshinecowboy](https://forum.torproject.org/u/sunshinecowboy)
#### Post date: [April 17, 2024, 8:45pm UTC](https://forum.torproject.org/t/centos-9-tor-relay-setup-keeps-getting-this-error/12321/10 "2024-04-17T20:45:26Z")

</div>

Make sure the user tor exists by checking your /etc/passwd file. If it doesn’t create a new one by: sudo useradd -d /var/lib/tor -s /bin/false -g tor

Then make sure tor has ownership of /var/lib/tor by: sudo ls -la /var/lib/tor  
if not do: `sudo chown -R tor:tor /var/lib/tor`

Now finally add the following lines to /etc/tor/torrc:

User tor  
Log notice syslog  
DataDirectory /var/lib/tor  
CookieAuthentication 1

Finally, let’s cleanly restart the systemd service:

```auto
sudo systemctl enable tor
sudo systemctl start tor

```

If everything works you should be able to check your relay by installing nyx, if it’s not already installed, and typing: `nyx -i 127.0.0.1:[your_control_port]`

If it doesn’t work now you should get a reading from: `sudo cat /var/log/syslog | grep 'Tor'`

---

<div class="post-metadata">

### Author: ![redacted4ever](https://forum.torproject.org/letter_avatar_proxy/v4/letter/r/7ba0ec/32.png) [@redacted4ever](https://forum.torproject.org/u/redacted4ever)
#### Post date: [April 18, 2024, 8:02am UTC](https://forum.torproject.org/t/centos-9-tor-relay-setup-keeps-getting-this-error/12321/11 "2024-04-18T08:02:48Z")

</div>

t worked thanks! I guess the user was not created this whole time then.

> **···**
>
> On Thu, Apr 18, 2024 at 2:25 AM Sunshinecowboy via Tor Project Forum \<[noreply@forum.torproject.org](mailto:noreply@forum.torproject.org)\> wrote:
> 
> > > ![](https://forum.torproject.org/user_avatar/forum.torproject.org/sunshinecowboy/45/4558_2.png "sunshinecowboy") | [sunshinecowboy](https://forum.torproject.org/u/sunshinecowboy)  
> > > April 17 |
> > > 
> > > - | - |
> > 
> > Make sure the user tor exists by checking your /etc/passwd file. If it doesn’t create a new one by: sudo useradd -d /var/lib/tor -s /usr/sbin/nologin -g tor
> > 
> > Then make sure tor has ownership of /var/lib/tor by: sudo ls -la /var/lib/tor  
> > if not do: `sudo chown -R tor:tor /var/lib/tor`
> > 
> > Now finally add the following lines to /etc/tor/torrc:
> > 
> > User tor  
> > Log notice syslog  
> > DataDirectory /var/lib/tor  
> > CookieAuthentication 1
> > 
> > Finally, let’s cleanly restart the systemd service:
> > 
> > ```auto
> > sudo systemctl enable tor
> > sudo systemctl start tor
> > 
> > ```
> > 
> > If everything works you should be able to check your relay by installing nyx, if it’s not already installed, and typing: `nyx -i 127.0.0.1:[your_control_port]`
> > 
> > If it doesn’t work now you should get a reading from: `sudo cat /var/log/syslog | grep 'Tor'`
> > 
> > * * *
> > 
> > [Visit Topic](https://forum.torproject.org/t/centos-9-tor-relay-setup-keeps-getting-this-error/12321/10) or reply to this email to respond.
> > 
> > To unsubscribe from these emails, [click here](https://forum.torproject.org/email/unsubscribe/af24f9396517c28e604f2b2885b63df5587773b141662245feadb246006e56d0).

---

<div class="post-metadata">

### Author: ![sunshinecowboy](https://forum.torproject.org/user_avatar/forum.torproject.org/sunshinecowboy/32/4558_2.png) [@sunshinecowboy](https://forum.torproject.org/u/sunshinecowboy)
#### Post date: [April 18, 2024, 5:00pm UTC](https://forum.torproject.org/t/centos-9-tor-relay-setup-keeps-getting-this-error/12321/12 "2024-04-18T17:00:40Z")

</div>

CentOS will often create the default user ‘toranon’ for which you would just need to replace the user ‘tor’ with in the steps above.
