Hello,



during MX Linux boot i am seeing errors
"Could not bind to 127.0.0.1:9050" when system is starting tor service at boot time."

Can you suggest what to try?


netstat -tulnp|grep tor

Code:
tcp        0      0 127.0.0.1:9050          0.0.0.0:*               LISTEN      2773/tor            
 tcp        0      0 127.0.0.1:9051          0.0.0.0:*               LISTEN      2773/tor

lsof -p 2773
Code:
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
       Output information may be incomplete.
 COMMAND  PID USER   FD      TYPE             DEVICE SIZE/OFF   NODE NAME
 tor     2773 root  cwd       DIR                8,3     4096 260553 /root
 tor     2773 root  rtd       DIR                8,3     4096      2 /
 tor     2773 root  txt       REG                8,3  3092568 264462 /usr/bin/tor
 tor     2773 root  mem       REG                8,3  3664586 518314 /root/.tor/cached-microdescs
 tor     2773 root  mem       REG                8,3    92584 260110 /lib/x86_64-linux-gnu/libgcc_s.so.1
 tor     2773 root  mem       REG                8,3    79936 260116 /lib/x86_64-linux-gnu/libgpg-error.so.0.21.0
 tor     2773 root  mem       REG                8,3   468920 260188 /lib/x86_64-linux-gnu/libpcre.so.3.13.3
 tor     2773 root  mem       REG                8,3  1112184 262104 /lib/x86_64-linux-gnu/libgcrypt.so.20.1.6
 tor     2773 root  mem       REG                8,3    72024 275920 /usr/lib/x86_64-linux-gnu/liblz4.so.1.7.1
 tor     2773 root  mem       REG                8,3    31744 263638 /lib/x86_64-linux-gnu/librt-2.24.so
 tor     2773 root  mem       REG                8,3   155400 260205 /lib/x86_64-linux-gnu/libselinux.so.1
 tor     2773 root  mem       REG                8,3  1689360 262790 /lib/x86_64-linux-gnu/libc-2.24.so
 tor     2773 root  mem       REG                8,3    14640 262794 /lib/x86_64-linux-gnu/libdl-2.24.so
 tor     2773 root  mem       REG                8,3   135440 263633 /lib/x86_64-linux-gnu/libpthread-2.24.so
 tor     2773 root  mem       REG                8,3    22768 260082 /lib/x86_64-linux-gnu/libcap.so.2.25
 tor     2773 root  mem       REG                8,3   284968 261168 /lib/x86_64-linux-gnu/libseccomp.so.2.3.1
 tor     2773 root  mem       REG                8,3   542632 260351 /usr/lib/x86_64-linux-gnu/libzstd.so.1.1.2
 tor     2773 root  mem       REG                8,3   154376 260131 /lib/x86_64-linux-gnu/liblzma.so.5.2.2
 tor     2773 root  mem       REG                8,3  2711616 272561 /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
 tor     2773 root  mem       REG                8,3   442984 272562 /usr/lib/x86_64-linux-gnu/libssl.so.1.1
 tor     2773 root  mem       REG                8,3   293264 275370 /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5.1.9
 tor     2773 root  mem       REG                8,3  1063328 262795 /lib/x86_64-linux-gnu/libm-2.24.so
 tor     2773 root  mem       REG                8,3   105088 260237 /lib/x86_64-linux-gnu/libz.so.1.2.8
 tor     2773 root  mem       REG                8,3   153288 262786 /lib/x86_64-linux-gnu/ld-2.24.so
 tor     2773 root  mem       REG                8,3   557552 259934 /lib/x86_64-linux-gnu/libsystemd.so.0.17.0
 tor     2773 root    0r      CHR                1,3      0t0   5384 /dev/null
 tor     2773 root    1u      REG                8,3     1991   3213 /var/tmp/tmpfo5pdXp (deleted)
 tor     2773 root    2u      REG                8,3     1991   3213 /var/tmp/tmpfo5pdXp (deleted)
 tor     2773 root    3u  a_inode               0,13        0   5382 [eventpoll]
 tor     2773 root    4u     unix 0x00000000b40823f0      0t0  12024 type=STREAM
 tor     2773 root    5u     unix 0x00000000453c5640      0t0  12025 type=STREAM
 tor     2773 root    6u     IPv4              12026      0t0    TCP localhost:9050 (LISTEN)
 tor     2773 root    7u     IPv4              12027      0t0    TCP localhost:9051 (LISTEN)
 tor     2773 root    8uW     REG                8,3        0 523232 /root/.tor/lock
 tor     2773 root   11u     IPv4              10681      0t0    TCP lynx:45728->207.180.224.17:9001 (ESTABLISHED)

service tor status
Code:
[FAIL] tor is not running ... failed!

grep -v "#" /etc/tor/torrc
Code:
ControlPort 9051
 CookieAuthentication 1

find /etc/init* -type f -iname *tor*

Code:
/etc/init.d/tor
find /etc/init* -type f -iname *tor*

Solution

After doing "grep tor /var/log/syslog" i found that there is the cronjob that launching tor. So i searched and found i added a cronjob that was starting the Tor init script manually at boot. So i removed this and then the tor service normally started at next reboot.