Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: [SOLVED] Please tell me how to turn on the start of the Tor service on Runit (Read 517 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[SOLVED] Please tell me how to turn on the start of the Tor service on Runit

As I asked.
I've added:
Code: [Select]
nano / etc / runit / sv / tor / run
Content:
Code: [Select]
#!/bin/sh
exec 2>&1
exec /usr/bin/tor -D
Command on Terminal:
Code: [Select]
ln -s /etc/runit/sv/tor /run/runit/service
sv u tor
sv start tor
sv restart tor
Code: [Select]
ps -A | grep tor
sv status /run/runit/service/*
Everything still doesn't work:
Code: [Select]
down: /run/runit/service/tor: 1s, normally up, want up
Can you show me where the mistake is?
Thanks

Re: Please tell me how to turn on the start of the Tor service on Runit

Reply #1
@artoo
Can you help me with this
Sorry if it bothers you

Re: Please tell me how to turn on the start of the Tor service on Runit

Reply #2
@artoo
Can you help me with this
Sorry if it bothers you
konimex is usually responsible for runit
As of your question, i'm not sure if linking to /run/runit/service is correct in Artix. To start service i usually use
Code: [Select]
ln -s /etc/runit/sv/service /etc/runit/runsvdir/default/<service name>
. In that case runit starts the service immideately. If for some reason it still doesn't work, try running commands from the init script manually to see if there are any error messages

Re: Please tell me how to turn on the start of the Tor service on Runit

Reply #3
Thank you for supporting me.
I fixed the following error:
Code: [Select]
nano /etc/runit/sv/tor/run
The following content:
Code: [Select]
#!/bin/sh
sv check dbus >/dev/null || exit 1
exec /usr/bin/tor -D -n > /dev/null 2>&1
Everything worked

Re: Please tell me how to turn on the start of the Tor service on Runit

Reply #4
Hello, and apologies for the late response. While I'm glad you have solved the problem, we actually have the package to deal with tor, tor-runit.

Simply install tor-runit and it should be done. You can activate it like usual. However since you created the tor file, it will conflict with the package. The contents of the ./run file isn't that different, just

#!/bin/sh
exec tor --quiet --runasdaemon 0 2>&1

Cheers!
the runit guy on artix

 

Re: Please tell me how to turn on the start of the Tor service on Runit

Reply #5
I have just been to Runit recently
Everything is quite new to me
Thank you

Re: [SOLVED] Please tell me how to turn on the start of the Tor service on Runit

Reply #6
Hello, and apologies for the late response. While I'm glad you have solved the problem, we actually have the package to deal with tor, tor-runit.

Simply install tor-runit and it should be done. You can activate it like usual. However since you created the tor file, it will conflict with the package. The contents of the ./run file isn't that different, just

#!/bin/sh
exec tor --quiet --runasdaemon 0 2>&1

Cheers!

There seems to be a problem with tor and runit. Here is the issue I faced.

I've installed tor and tor-runit. I added tor to the runit services:

Code: [Select]
ln -s /etc/runit/sv/tor /run/runit/service

But it doesn't start. Even if I stop and restart, when I start tor from runit, it doesn't start.
Code: [Select]
down: /run/runit/service/tor: 1s, normally up, want up

 I'm not sure how to check for the log for a runit service, so I tried to start tor manually, and this is what I get.
Code: [Select]
$ sudo tor 
[notice] Tor 0.4.3.5 running on Linux with Libevent 2.1.11-stable, OpenSSL 1.1.1g, Zlib 1.2.11, Liblzma 5.2.5, and Libzstd 1.4.4.
[notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
[notice] Read configuration file "/etc/tor/torrc".
[notice] Opening Socks listener on 127.0.0.1:9050
[notice] Opened Socks listener on 127.0.0.1:9050
[warn] /var/lib/tor is not owned by this user (root, 0) but by tor (43). Perhaps you are running Tor as the wrong user?
[notice] Closing partially-constructed Socks listener on 127.0.0.1:9050
[warn] Failed to parse/validate config: Couldn't create private data directory "/var/lib/tor"
[err] Reading config failed--see warnings above.

It seems that when installed with pacman, tor creates a director /var/lib/tor owned by the user tor (I've since removed this dir and reinstalled tor and to check if it's created during installation).
Anyway, my fix was to change the ownership of  /var/lib/tor  to the root user.

I'm not sure if I'm missing something, or tor changed its behavior recently, but is this the right way to solve it?