mirror of
https://github.com/DNSCrypt/dnscrypt-proxy.git
synced 2025-03-04 02:14:40 +01:00
systemd: report Ready earlier as dnscrypt-proxy can itself manage retries for updates/refreshes (#2225)
This commit is contained in:
parent
09a6918226
commit
77059ce450
1 changed files with 9 additions and 5 deletions
|
@ -233,6 +233,15 @@ func (proxy *Proxy) StartProxy() {
|
|||
}
|
||||
curve25519.ScalarBaseMult(&proxy.proxyPublicKey, &proxy.proxySecretKey)
|
||||
proxy.startAcceptingClients()
|
||||
if !proxy.child {
|
||||
// Notify systemd that dnscrypt-proxy is ready. dnscrypt-proxy manages itself in case
|
||||
// servers are not immediately live/reachable. Systemd may assume it is initialized and
|
||||
// functioning properly. Note that the systemd notify 'Ready' signal is delayed if netprobe
|
||||
// cannot reach the internet during start-up.
|
||||
if err := ServiceManagerReadyNotify(); err != nil {
|
||||
dlog.Fatal(err)
|
||||
}
|
||||
}
|
||||
liveServers, err := proxy.serversInfo.refresh(proxy)
|
||||
if liveServers > 0 {
|
||||
proxy.certIgnoreTimestamp = false
|
||||
|
@ -242,11 +251,6 @@ func (proxy *Proxy) StartProxy() {
|
|||
}
|
||||
if liveServers > 0 {
|
||||
dlog.Noticef("dnscrypt-proxy is ready - live servers: %d", liveServers)
|
||||
if !proxy.child {
|
||||
if err := ServiceManagerReadyNotify(); err != nil {
|
||||
dlog.Fatal(err)
|
||||
}
|
||||
}
|
||||
} else if err != nil {
|
||||
dlog.Error(err)
|
||||
dlog.Notice("dnscrypt-proxy is waiting for at least one server to be reachable")
|
||||
|
|
Loading…
Add table
Reference in a new issue