From ed79bd74890dfcf2c550e73cdb8a6732e669bc0d Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Mon, 16 Sep 2019 15:46:39 +0200 Subject: [PATCH] Deprecate systemd sockets --- dnscrypt-proxy/example-dnscrypt-proxy.toml | 1 - dnscrypt-proxy/systemd_linux.go | 8 +++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/dnscrypt-proxy/example-dnscrypt-proxy.toml b/dnscrypt-proxy/example-dnscrypt-proxy.toml index 8455f8dd..c993b3da 100644 --- a/dnscrypt-proxy/example-dnscrypt-proxy.toml +++ b/dnscrypt-proxy/example-dnscrypt-proxy.toml @@ -31,7 +31,6 @@ ## List of local addresses and ports to listen to. Can be IPv4 and/or IPv6. -## Note: When using systemd socket activation, choose an empty set (i.e. [] ). listen_addresses = ['127.0.0.1:53', '[::1]:53'] diff --git a/dnscrypt-proxy/systemd_linux.go b/dnscrypt-proxy/systemd_linux.go index ea28368f..7b770bde 100644 --- a/dnscrypt-proxy/systemd_linux.go +++ b/dnscrypt-proxy/systemd_linux.go @@ -10,10 +10,12 @@ func (proxy *Proxy) SystemDListeners() error { files := activation.Files(true) - if len(files) > 0 && (len(proxy.userName) > 0 || proxy.child) { - dlog.Fatal("Systemd activated sockets are incompatible with privilege dropping. Remove activated sockets and fill `listen_addresses` in the dnscrypt-proxy configuration file instead.") + if len(files) > 0 { + if (len(proxy.userName) > 0 || proxy.child) { + dlog.Fatal("Systemd activated sockets are incompatible with privilege dropping. Remove activated sockets and fill `listen_addresses` in the dnscrypt-proxy configuration file instead.") + } + dlog.Warn("Systemd sockets are untested and unsupported - use at your own risk") } - for i, file := range files { if listener, err := net.FileListener(file); err == nil { dlog.Noticef("Wiring systemd TCP socket #%d, %s, %s", i, file.Name(), listener.Addr())