From 3fe60f64c46cf9e8bc0ea16607041ad09af4d598 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Wed, 10 Jan 2018 19:49:02 +0100 Subject: [PATCH] So, daemonization only works on linux :/ --- dnscrypt-proxy/daemonize.go | 9 +++++++++ dnscrypt-proxy/daemonize_placeholder.go | 6 ++++++ dnscrypt-proxy/main.go | 4 +--- 3 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 dnscrypt-proxy/daemonize.go create mode 100644 dnscrypt-proxy/daemonize_placeholder.go diff --git a/dnscrypt-proxy/daemonize.go b/dnscrypt-proxy/daemonize.go new file mode 100644 index 00000000..b4b0a914 --- /dev/null +++ b/dnscrypt-proxy/daemonize.go @@ -0,0 +1,9 @@ +// +build linux + +package main + +import "github.com/VividCortex/godaemon" + +func Daemonize() { + godaemon.MakeDaemon(&godaemon.DaemonAttr{}) +} diff --git a/dnscrypt-proxy/daemonize_placeholder.go b/dnscrypt-proxy/daemonize_placeholder.go new file mode 100644 index 00000000..0139621f --- /dev/null +++ b/dnscrypt-proxy/daemonize_placeholder.go @@ -0,0 +1,6 @@ +// +build !linux + +package main + +func Daemonize() { +} diff --git a/dnscrypt-proxy/main.go b/dnscrypt-proxy/main.go index 1b0e05db..3eae555b 100644 --- a/dnscrypt-proxy/main.go +++ b/dnscrypt-proxy/main.go @@ -7,8 +7,6 @@ import ( "net" "time" - "github.com/VividCortex/godaemon" - "golang.org/x/crypto/curve25519" ) @@ -38,7 +36,7 @@ func main() { panic(err) } if proxy.daemonize { - godaemon.MakeDaemon(&godaemon.DaemonAttr{}) + Daemonize() } proxy.StartProxy() }