Bug#852716: tor logging should default to syslog when run under systemd, not /var/log/tor/log

2017-02-04 Thread Peter Palfrader
On Fri, 03 Feb 2017, Daniel Kahn Gillmor wrote:

> so i'm a little confused about how the debian package is defaulting to
> /var/log/tor/log anyway :/

| weasel@valiant:~$ grep -i Log /usr/share/tor/tor-service-defaults-torrc*
| /usr/share/tor/tor-service-defaults-torrc:Log notice file /var/log/tor/log
| /usr/share/tor/tor-service-defaults-torrc-instances:SyslogIdentityTag @@NAME@@
| /usr/share/tor/tor-service-defaults-torrc-instances:Log notice syslog

Cheers,
-- 
|  .''`.   ** Debian **
  Peter Palfrader   | : :' :  The  universal
 https://www.palfrader.org/ | `. `'  Operating System
|   `-https://www.debian.org/



Bug#852716: tor logging should default to syslog when run under systemd, not /var/log/tor/log

2017-02-03 Thread Daniel Kahn Gillmor
On Tue 2017-01-31 07:53:12 -0500, Peter Palfrader wrote:
> On Thu, 26 Jan 2017, Daniel Kahn Gillmor wrote:
>
>> I've got a very tightly-configured machine running little but the
>> kernel and systemd and tor.  It uses journald and does not use any
>> traditional syslog.
>
> I think logging to /var/log/tor/log made sense historically, when we
> launched via sysV init script yet the default tor just wrote to stdout.
>
> I'm not averse to changing the default (unconditionally) to syslog for 3.x.

do you need a patch for this?  in src/or/config.c, it looks like it's
currently logging by default to stdout still:


  /* Special case on first boot if no Log options are given. */
  if (!options->Logs && !options->RunAsDaemon && !from_setconf) {
if (quiet_level == 0)
config_line_append(&options->Logs, "Log", "notice stdout");
else if (quiet_level == 1)
config_line_append(&options->Logs, "Log", "warn stdout");
  }


so i'm a little confused about how the debian package is defaulting to
/var/log/tor/log anyway :/

 --dkg


signature.asc
Description: PGP signature


Bug#852716: tor logging should default to syslog when run under systemd, not /var/log/tor/log

2017-01-31 Thread Peter Palfrader
On Thu, 26 Jan 2017, Daniel Kahn Gillmor wrote:

> I've got a very tightly-configured machine running little but the
> kernel and systemd and tor.  It uses journald and does not use any
> traditional syslog.

I think logging to /var/log/tor/log made sense historically, when we
launched via sysV init script yet the default tor just wrote to stdout.

I'm not averse to changing the default (unconditionally) to syslog for 3.x.

Cheers
-- 
|  .''`.   ** Debian **
  Peter Palfrader   | : :' :  The  universal
 https://www.palfrader.org/ | `. `'  Operating System
|   `-https://www.debian.org/



Bug#852716: tor logging should default to syslog when run under systemd, not /var/log/tor/log

2017-01-26 Thread Daniel Kahn Gillmor
Package: tor
Version: 0.3.0.2-alpha-1.1
Severity: normal

I've got a very tightly-configured machine running little but the
kernel and systemd and tor.  It uses journald and does not use any
traditional syslog.

by not creating /var/log/journal, i'm expecting the machine to not
write any permanent logs.  But tor is writing permanant logs to
/var/log/tor/log, and it's the only thing on the system that does so:

0 root@foo:~# find  /var/log/ -type f -print0 | xargs -0 lsof 
COMMAND  PID   USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
tor 4175 debian-tor7w   REG  253,4 2541 1414 /var/log/tor/log
123 root@foo:~# 

when the tor system service is controlled by systemd, it should send
its logs by default to journald, rather than writing them manually to
its own logfiles.  It can do this by writing to stderr or stdout or
syslog.  syslog is probably preferable because that lets it
communicate the "level" of the log message to journald at the same
time.

This has several advantages:

 * admins can centrally control logging without having to know about
   each specific service

 * logrotate is not needed, which means that there will not be
   periodic interruptions of the tor daemon with "service tor reload"
   called from postrotate

 * there's no need to manually create /var/log/tor during service
   initialization

The torrc makes no claims about what the default logging mechanism is.
Can we just change the default to "Log notice syslog" ?  If not, can
we at least apply that change by default to tor when it's launched as
a standard systemd service?

 --dkg

-- System Information:
Debian Release: 9.0
  APT prefers testing-debug
  APT policy: (500, 'testing-debug'), (500, 'testing'), (200, 
'unstable-debug'), (200, 'unstable'), (1, 'experimental-debug'), (1, 
'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.8.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages tor depends on:
ii  adduser  3.115
ii  init-system-helpers  1.46
ii  libc62.24-8
ii  libcap2  1:2.25-1
ii  libevent-2.0-5   2.0.21-stable-2.1
ii  libseccomp2  2.3.1-2.1
ii  libssl1.11.1.0c-2
ii  libsystemd0  232-8
ii  lsb-base 9.20161125
ii  zlib1g   1:1.2.8.dfsg-4

Versions of packages tor recommends:
pn  logrotate
ii  tor-geoipdb  0.3.0.2-alpha-1.1
ii  torsocks 2.2.0-1

Versions of packages tor suggests:
pn  apparmor-utils   
pn  mixmaster
pn  obfs4proxy   
pn  obfsproxy
ii  socat1.7.3.1-2
pn  tor-arm  
ii  torbrowser-launcher  0.2.6-3

-- no debconf information