Daemon: 1 - Direct(CLI):0

Hi,

When I’m launching tor trough runuser -u debian-tor -- tor
I get stuck at

Opened Socks listener connection (ready) on 127.0.0.1:9050

torrc is in it’s stock state (nothing has been uncommented)

but when I’m launching the daemon /etc/init.d/tor startit seem to go further (sadly nothing come to the sdout / terminal :confused: )

I’ve noticed that /etc/init.d/tor include extra config for tor

/usr/share/tor/tor-service-defaults-torrc

DataDirectory /var/lib/tor
PidFile /run/tor/tor.pid
RunAsDaemon 1
User debian-tor

ControlSocket /run/tor/control GroupWritable RelaxDirModeCheck
ControlSocketsGroupWritable 1
SocksPort unix:/run/tor/socks WorldWritable
SocksPort 9050

CookieAuthentication 1
CookieAuthFileGroupReadable 1
CookieAuthFile /run/tor/control.authcookie

Log notice syslog

  1. Are all of those save ?
  2. why without it it seem not working ?
  3. How could I launch the daemon and see the live sdout output ?

Thanks

If you want the same behavior like the SysV daemon, then you must launch the tor command with the same configuration as SysV daemon of course:

runuser -u debian-tor -- tor --defaults-torrc /usr/share/tor/tor-service-defaults-torrc -f /etc/tor/torrc --RunAsDaemon 0

Except RunAsDaemon should be 0.
This way you’ll see the same output as from daemon on stdout/stderr.
The default config is safe.

The output from the daemon can be observed in the log:
/var/log/tor/notices.log
If this file doesn’t exist, then the output is in the syslog.

1 Like

Is two lines are required under sysVinit system, or while running as daemon ?

ControlSocket /run/tor/control GroupWritable RelaxDirModeCheck
ControlSocketsGroupWritable 1

Why are they are there by default ?

Thanks