0

When I run

service tor stop

The process is still running

If I run

service tor restart

and then

cat /var/log/syslog | grep tor -i

I get a lot of warnings and errors (see below). It seems it's trying 5 times. These records are repeated 5 times and restart counter increments up to 5

It seems that tor cannot be stopped or restarted.

How to make it to operate normally? Is it safe if I kill the process?


Apr 12 13:51:39 myproject tor[32894]: Apr 12 13:51:39.762 [notice] Tor 0.4.2.6 running on Linux with Libevent 2.1.8-stable, OpenSSL 1.1.1, Zlib 1.2.11, Liblzma 5.2.2, and Libzstd 1.3.3.
Apr 12 13:51:39 myproject tor[32894]: Apr 12 13:51:39.762 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
Apr 12 13:51:39 myproject tor[32894]: Apr 12 13:51:39.762 [notice] Read configuration file "/usr/share/tor/tor-service-defaults-torrc".
Apr 12 13:51:39 myproject tor[32894]: Apr 12 13:51:39.762 [notice] Read configuration file "/etc/tor/torrc".
Apr 12 13:51:39 myproject tor[32894]: Configuration was valid
Apr 12 13:51:39 myproject tor[32895]: Apr 12 13:51:39.932 [notice] Tor 0.4.2.6 running on Linux with Libevent 2.1.8-stable, OpenSSL 1.1.1, Zlib 1.2.11, Liblzma 5.2.2, and Libzstd 1.3.3.
Apr 12 13:51:39 myproject tor[32895]: Apr 12 13:51:39.932 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
Apr 12 13:51:39 myproject tor[32895]: Apr 12 13:51:39.932 [notice] Read configuration file "/usr/share/tor/tor-service-defaults-torrc".
Apr 12 13:51:39 myproject tor[32895]: Apr 12 13:51:39.932 [notice] Read configuration file "/etc/tor/torrc".
Apr 12 13:51:39 myproject tor[32895]: Apr 12 13:51:39.935 [notice] Opening Socks listener on 127.0.0.1:9050
Apr 12 13:51:39 myproject tor[32895]: Apr 12 13:51:39.935 [warn] Could not bind to 127.0.0.1:9050: Address already in use. Is Tor already running?
Apr 12 13:51:39 myproject tor[32895]: Apr 12 13:51:39.935 [notice] Opening HTTP tunnel listener on 127.0.0.1:9080
Apr 12 13:51:39 myproject tor[32895]: Apr 12 13:51:39.935 [warn] Could not bind to 127.0.0.1:9080: Address already in use. Is Tor already running?
Apr 12 13:51:39 myproject tor[32895]: Apr 12 13:51:39.935 [warn] Failed to parse/validate config: Failed to bind one of the listener ports.
Apr 12 13:51:39 myproject tor[32895]: Apr 12 13:51:39.935 [err] Reading config failed--see warnings above.
Apr 12 13:51:39 myproject systemd[1]: tor@default.service: Main process exited, code=exited, status=1/FAILURE
Apr 12 13:51:39 myproject systemd[1]: tor@default.service: Failed with result 'exit-code'.
Apr 12 13:51:40 myproject systemd[1]: tor@default.service: Service hold-off time over, scheduling restart.
Apr 12 13:51:40 myproject systemd[1]: tor@default.service: Scheduled restart job, restart counter is at 1.
  • It seems that tor is already running (probably outside of a service). You should kill all running tor processes and try restating the service. If that doesn't work, then please add more information to the question: How did you install tor? Are you running any other tor-related programs? What changes have you made to your tor configuration? Can you list all running tor processes? Etc. – Steve Apr 12 at 20:03
  • I commented all changes in torrc. I see the process like this /etc/tor# ps aux | grep tor root 1155 0.0 0.0 16148 1060 pts/1 S+ 19:42 0:00 grep --color=auto tor debian-+ 13017 0.1 1.3 107520 52868 ? S Mar02 74:56 /usr/bin/tor --defaults-torrc /usr/share/tor/tor-service-defaults-torrc -f /etc/tor/torrc --RunAsDaemon 1 – AlexSor Apr 12 at 21:08
  • 1
    I finally killed the process and started again service tor start. Now everything is okay in syslog and when I restart tor I see pid is being changed. – AlexSor Apr 12 at 21:33
  • Glad to hear you fixed it. It is okay to send a SIGINT or SIGTERM to tor, and it will shut down safely (SIGINT is preferable though). – Steve Apr 12 at 21:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.