]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
systemd: Add "After" dependency on time-sync.target 12248/head
authorKevin P. Fleming <kevin@km6g.us>
Tue, 29 Nov 2022 11:14:10 +0000 (06:14 -0500)
committerKevin P. Fleming <kevin@km6g.us>
Tue, 29 Nov 2022 11:17:32 +0000 (06:17 -0500)
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
pdns/ixfrdist.service.in
pdns/pdns.service.in
pdns/recursordist/pdns-recursor.service.in

index 5b2205345f15f87ce5c8aafa10373ddbec234f02..651f9b32dc3f3bc3cdcb9ca436b3504361cab35d 100644 (file)
@@ -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
index c2efb8ca857e7f5cce55e5365a677e434d0731fa..7aeab5138904b0b770e30edcdfb0b3e134890e98 100644 (file)
@@ -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
index 3c43b076dbed3ef0a9dc0b292887fdc2ff82bf8d..368348ebdc1f29789a4030ed3fe04331a79feecb 100644 (file)
@@ -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
index 886b90655da0fa4befbb49f94095886abe4c7c1c..1ca38203cba9ca757fd470eea5f3fce64ff38ccc 100644 (file)
@@ -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