dnscrypt-proxy icon indicating copy to clipboard operation
dnscrypt-proxy copied to clipboard

Logging not working (Ubuntu 18 and Debian 9)

Open n8sask opened this issue 8 years ago • 14 comments

I have read through the previous issues and resolutions with no avail. I've fresh installed on both my Debian and Ubuntu instances and neither of them are pushing out logs. I've tried the stock config and enabling one option at a time just as suggested none of which is pushing any logging information to syslog or any log file.

Is there a way to troubleshoot as to what is causing this?

n8sask avatar Oct 23 '18 18:10 n8sask

How did you install it?

jedisct1 avatar Oct 23 '18 19:10 jedisct1

I tried with the built in installer on both systems.

n8sask avatar Oct 23 '18 21:10 n8sask

Can you post a minimally changed config file somewhere?

jedisct1 avatar Oct 23 '18 21:10 jedisct1

https://pastebin.com/VnPwAPbN

n8sask avatar Oct 23 '18 21:10 n8sask

I just setup another instance on an Ubuntu 18 box and I only changed:

server_names = ['dns00']
listen_addresses = ['127.0.0.1:5353']
log_file = 'dnscrypt-proxy.log'
<commented out public servers>
<added dns00>

~~Same result. no logs.~~ Rebooted instance after installing the service and logs showed up in the /opt/dnscrypt-proxy folder

n8sask avatar Oct 23 '18 21:10 n8sask

listen_addresses = []

How can that work? You need an actual address here.

fallback_resolver = '0.0.0.0:53'

How can that work? You can't connect to 0.0.0.0, at best it will loop.

So, if you send a query to a nonexistent name, is the /var/log/dnscrypt-proxy/dnsnx.log file at least created?

jedisct1 avatar Oct 23 '18 22:10 jedisct1

The pastebin config is for a systemd configuration.

Here is my systemd service:

[Unit]
Description=DNSCrypt-proxy client
Documentation=https://github.com/jedisct1/dnscrypt-proxy/wiki
Requires=dnscrypt-proxy.socket
After=network.target
Before=nss-lookup.target
Wants=nss-lookup.target

[Service]
NonBlocking=true
ExecStart=/opt/dnscrypt-proxy/dnscrypt-proxy --config /opt/dnscrypt-proxy/dnscrypt-proxy.toml
ProtectHome=yes
ProtectControlGroups=yes
ProtectKernelModules=yes

DynamicUser=yes
CacheDirectory=dnscrypt-proxy
LogsDirectory=dnscrypt-proxy
RuntimeDirectory=dnscrypt-proxy

[Install]
Also=dnscrypt-proxy.socket
WantedBy=multi-user.target

The socket file:

[Unit]
Description=DNSCrypt-proxy socket
Documentation=https://github.com/jedisct1/dnscrypt-proxy/wiki
Before=nss-lookup.target
Wants=nss-lookup.target

[Socket]
ListenStream=127.0.0.1:5353
ListenDatagram=127.0.0.1:5353
NoDelay=true
DeferAcceptSec=1

[Install]
WantedBy=sockets.target

n8sask avatar Oct 23 '18 22:10 n8sask

Where does all this systemd junk come from? The -service install command would never install anything like that.

jedisct1 avatar Oct 23 '18 22:10 jedisct1

listen_addresses = []

How can that work? You need an actual address here.

as per systemd socket configuration

fallback_resolver = '0.0.0.0:53'

How can that work? You can't connect to 0.0.0.0, at best it will loop.

So, if you send a query to a nonexistent name, is the /var/log/dnscrypt-proxy/dnsnx.log file at least created?

I do not want a fallback resolver. I do not get any logs showing up in /var/log/dnscrypt-proxy.

n8sask avatar Oct 23 '18 22:10 n8sask

Where does all this systemd junk come from? The -service install command would never install anything like that.

Came from your wiki: https://github.com/jedisct1/dnscrypt-proxy/wiki/systemd

n8sask avatar Oct 23 '18 22:10 n8sask

Remove everything and just use -service install.

jedisct1 avatar Oct 23 '18 22:10 jedisct1

Got it to work on the Debian box!

For some reason or another there were 2x empty files in /etc/systemd/system that was preventing the service from installing...

[dns00 /opt/dnscrypt-proxy]# ls /etc/systemd/system
dnscrypt-proxy.socket
dnscrypt-proxy.service

Removed the files and then -service install did the trick.

Thank you for your time @jedisct1 I really appreciate it!

n8sask avatar Oct 23 '18 22:10 n8sask

That does not explain why logging doesn't work with normal systemd files.

eclipseo avatar Oct 23 '18 23:10 eclipseo

My bad, my system is configured with syslog.

eclipseo avatar Oct 23 '18 23:10 eclipseo