Page MenuHomePhabricator
Paste P7574

gdnsd lossless+downtimeless takeover on code version upgrade
ActivePublic

Authored by BBlack on Sep 20 2018, 2:24 PM.
# apt-get install gdnsd
[... postinst hook triggers "systemctl reload gdnsd.service" ...]
[syslog output with some long boring sections omitted:]
Sep 20 14:15:47 authdns1001 systemd[1]: Reloading gdnsd.
Sep 20 14:15:47 authdns1001 gdnsdctl[48274]: REPLACE[gdnsdctl]: Sending replace command to old daemon version 2.99.9 running at PID 72286
Sep 20 14:15:47 authdns1001 gdnsd[72286]: REPLACE[old daemon]: Accepted replace command, spawned replacement daemon at PID 48276
Sep 20 14:15:47 authdns1001 gdnsd[48276]: DNS listener threads (8 UDP + 8 TCP) configured for 0.0.0.0:53
Sep 20 14:15:47 authdns1001 gdnsd[48276]: DNS listener threads (8 UDP + 8 TCP) configured for [::]:53
Sep 20 14:15:47 authdns1001 gdnsd[48276]: [... tons of startup messages for 2s, loading geoip + zones ...]
Sep 20 14:15:49 authdns1001 gdnsd[48276]: rfc1035: Loaded 207 zonefiles from '/etc/gdnsd/zones/'
Sep 20 14:15:49 authdns1001 gdnsd[48276]: REPLACE[new daemon]: Connected to old daemon version 2.99.9 at PID 72286 for takeover
Sep 20 14:15:49 authdns1001 gdnsd[48276]: [... tons of messages about dyn resource state initialization ...]
Sep 20 14:15:49 authdns1001 gdnsd[48276]: admin_state: load complete
Sep 20 14:15:49 authdns1001 gdnsd[72286]: REPLACE[old daemon]: Accepting takeover request from spawned replacement PID 48276, sending 32 DNS sockets
Sep 20 14:15:49 authdns1001 gdnsd[48276]: REPLACE[new daemon]: Takeover request accepted, received 32 DNS sockets
Sep 20 14:15:49 authdns1001 gdnsd[48276]: DNS listeners started
Sep 20 14:15:49 authdns1001 gdnsd[72286]: REPLACE[old daemon]: Exiting cleanly at request of new daemon
Sep 20 14:15:49 authdns1001 gdnsd[48276]: REPLACE[new daemon]: old daemon at PID 72286 exited as commanded
Sep 20 14:15:49 authdns1001 gdnsdctl[48274]: REPLACE[gdnsdctl]: old daemon at PID 72286 exited as commanded
Sep 20 14:15:49 authdns1001 gdnsdctl[48274]: REPLACE[gdnsdctl]: SUCCESS, new daemon version 2.99.42 running at PID 48276
Sep 20 14:15:49 authdns1001 systemd[1]: Reloaded gdnsd.
[note systemd-level uptime still reflects original start over a day ago, the unit never actually stopped:]
# systemctl status gdnsd
● gdnsd.service - gdnsd
Loaded: loaded (/lib/systemd/system/gdnsd.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2018-09-18 21:26:29 UTC; 1 day 16h ago
Docs: man:gdnsd
Main PID: 48276 (gdnsd)
CGroup: /system.slice/gdnsd.service
└─48276 /usr/sbin/gdnsd -c /etc/gdnsd -Rl start