From c6725600ec73a9e6d12da0b4fab8c41878be5f06 Mon Sep 17 00:00:00 2001 From: "Kevin P. Fleming" Date: Tue, 29 Nov 2022 06:14:10 -0500 Subject: [PATCH] systemd: Add "After" dependency on time-sync.target Adds 'After=time-sync.target' to the service unit files; this will not have any immediate effect, unless the system administrator has also enabled a unit which has a 'Before' dependency on that target; there are none of those units enabled in a default configuration in common distributions. systemd itself adds such an 'After' dependency to all timer units with OnCalendar settings, and to some other units. However, in a system which makes use of systemd-timesyncd, the admin can enable systemd-time-wait-sync.service, which has such a dependency. The result would be that none of the PowerDNS services on the system would be started until after systemd-timesyncd is certain that the system's clock is synchronized with the configured external source. A similar configuration can be achieved on systems which use ntpd, chronyd, or other time synchronization tools. Closes #11153. --- pdns/dnsdistdist/dnsdist.service.in | 2 +- pdns/ixfrdist.service.in | 2 +- pdns/pdns.service.in | 2 +- pdns/recursordist/pdns-recursor.service.in | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pdns/dnsdistdist/dnsdist.service.in b/pdns/dnsdistdist/dnsdist.service.in index 5b2205345f..651f9b32dc 100644 --- a/pdns/dnsdistdist/dnsdist.service.in +++ b/pdns/dnsdistdist/dnsdist.service.in @@ -3,7 +3,7 @@ Description=DNS Loadbalancer Documentation=man:dnsdist(1) Documentation=https://dnsdist.org Wants=network-online.target -After=network-online.target +After=network-online.target time-sync.target [Service] ExecStartPre=@bindir@/dnsdist --check-config diff --git a/pdns/ixfrdist.service.in b/pdns/ixfrdist.service.in index c2efb8ca85..7aeab51389 100644 --- a/pdns/ixfrdist.service.in +++ b/pdns/ixfrdist.service.in @@ -4,7 +4,7 @@ Documentation=man:ixfrdist(1) Documentation=man:ixfrdist.yml(5) Documentation=https://doc.powerdns.com Wants=network-online.target -After=network-online.target +After=network-online.target time-sync.target [Service] Type=simple diff --git a/pdns/pdns.service.in b/pdns/pdns.service.in index 3c43b076db..368348ebdc 100644 --- a/pdns/pdns.service.in +++ b/pdns/pdns.service.in @@ -3,7 +3,7 @@ Description=PowerDNS Authoritative Server Documentation=man:pdns_server(1) man:pdns_control(1) Documentation=https://doc.powerdns.com Wants=network-online.target -After=network-online.target mysqld.service postgresql.service slapd.service mariadb.service +After=network-online.target mysqld.service postgresql.service slapd.service mariadb.service time-sync.target [Service] ExecStart=@sbindir@/pdns_server --guardian=no --daemon=no --disable-syslog --log-timestamp=no --write-pid=no diff --git a/pdns/recursordist/pdns-recursor.service.in b/pdns/recursordist/pdns-recursor.service.in index 886b90655d..1ca38203cb 100644 --- a/pdns/recursordist/pdns-recursor.service.in +++ b/pdns/recursordist/pdns-recursor.service.in @@ -4,7 +4,7 @@ Documentation=man:pdns_recursor(1) man:rec_control(1) Documentation=https://doc.powerdns.com Wants=network-online.target nss-lookup.target Before=nss-lookup.target -After=network-online.target +After=network-online.target time-sync.target [Service] ExecStart=@sbindir@/pdns_recursor --daemon=no --write-pid=no --disable-syslog --log-timestamp=no -- 2.47.2