From fba3fada330e33a2a76aa35835888e32ed620a7f Mon Sep 17 00:00:00 2001
From: Donald Buczek <buczek@molgen.mpg.de>
Date: Thu, 29 Mar 2018 21:32:25 +0200
Subject: [PATCH] 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
+