File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -233,6 +233,15 @@ func (proxy *Proxy) StartProxy() {
233233 }
234234 curve25519 .ScalarBaseMult (& proxy .proxyPublicKey , & proxy .proxySecretKey )
235235 proxy .startAcceptingClients ()
236+ if ! proxy .child {
237+ // Notify systemd that dnscrypt-proxy is ready. dnscrypt-proxy manages itself in case
238+ // servers are not immediately live/reachable. Systemd may assume it is initialized and
239+ // functioning properly. Note that the systemd notify 'Ready' signal is delayed if netprobe
240+ // cannot reach the internet during start-up.
241+ if err := ServiceManagerReadyNotify (); err != nil {
242+ dlog .Fatal (err )
243+ }
244+ }
236245 liveServers , err := proxy .serversInfo .refresh (proxy )
237246 if liveServers > 0 {
238247 proxy .certIgnoreTimestamp = false
@@ -242,11 +251,6 @@ func (proxy *Proxy) StartProxy() {
242251 }
243252 if liveServers > 0 {
244253 dlog .Noticef ("dnscrypt-proxy is ready - live servers: %d" , liveServers )
245- if ! proxy .child {
246- if err := ServiceManagerReadyNotify (); err != nil {
247- dlog .Fatal (err )
248- }
249- }
250254 } else if err != nil {
251255 dlog .Error (err )
252256 dlog .Notice ("dnscrypt-proxy is waiting for at least one server to be reachable" )
You can’t perform that action at this time.
0 commit comments