From fba3fada330e33a2a76aa35835888e32ed620a7f Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Thu, 29 Mar 2018 21:32:25 +0200 Subject: [PATCH 1/2] Import existing named.service unit file into repository named.service is used on wtf only to start the bind named. The ConditionPathExists=/node/startup-hostname/wtf is a workaround, because we are running on an early systemd version which doesn't yet support ConditionHost. --- install.sh | 1 + misc_systemd_units/named.service | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 misc_systemd_units/named.service diff --git a/install.sh b/install.sh index 03444df..f0fefa9 100755 --- a/install.sh +++ b/install.sh @@ -109,5 +109,6 @@ install_exec kvm_monitor/kvm_monitor.pl "$DESTDIR$udev_helperdi install_data kvm_monitor/51-raritan-kvm.rules "$DESTDIR$udev_rulesdir/51-raritan-kvm.rules" install_data misc_systemd_units/udev-settled.target "$DESTDIR$systemdunitdir/udev-settled.target" install_exec mxmirror/mxmirror "$DESTDIR$usr_sbindir/mxmirror" +install_data misc_systemd_units/named.service "$DESTDIR$systemdunitdir/named.service" exit diff --git a/misc_systemd_units/named.service b/misc_systemd_units/named.service new file mode 100644 index 0000000..e4fee5a --- /dev/null +++ b/misc_systemd_units/named.service @@ -0,0 +1,16 @@ +[Unit] +After=network.service gateway.service mxmount.service automount.service + +Wants=startup-hostname.service +After=startup-hostname.service +ConditionPathExists=/node/startup-hostname/wtf + +[Service] +Type=forking +ExecStartPre=-/sbin/ip addr add 141.14.16.1/20 dev net03 +ExecStart=/package/dns/2014-12-03/sbin/named -4 -c /package/dns/2014-12-03/etc/named.conf +ExecStopPost=-/sbin/ip addr del 141.14.16.1/20 dev net03 + +[Install] +WantedBy=network.target + From 3f7674b3ad48096c112c606b20e08274e5d44c70 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Thu, 29 Mar 2018 21:49:03 +0200 Subject: [PATCH 2/2] named.service: Run before mxstartup-mxvip.service If _wtf_ is started when the Internet is not available, unbound is unable to verify DNSSEC and libc will fall back to query the bind named on 141.14.16.1, which should be able to resolve local names. Experiments showed however, that sometimes mxstartup is executed on _wtf_ before the bind nameserver has started. This can lead to name resolution failures and mxstartup services startup failures, if these have ip addresses configured by name. Add startup contraint to start named before mxstartup. --- misc_systemd_units/named.service | 1 + 1 file changed, 1 insertion(+) diff --git a/misc_systemd_units/named.service b/misc_systemd_units/named.service index e4fee5a..e1ddf64 100644 --- a/misc_systemd_units/named.service +++ b/misc_systemd_units/named.service @@ -3,6 +3,7 @@ After=network.service gateway.service mxmount.service automount.service Wants=startup-hostname.service After=startup-hostname.service +Before=mxstartup-mxvip.service ConditionPathExists=/node/startup-hostname/wtf [Service]