Ubuntu 18.04 PPA Package has broken systemd unit file
Summary
First of all it is sad that you break the Ubuntu schema and call the service "named" instead of the Ubuntu/Debian name "bind9". It is very confusing, ie you still use /etc/bind but you use /etc/default/named. I do not see any benefit in confusing Ubuntu users.
Further, Alias=bind9.service
must be in [Install]
section instead of [Unit]
section.
BIND version used
9.14.4-2+ubuntu18.04.1+deb.sury.org+1
BIND 9.14.4-Ubuntu (Stable Release) id:ab4c496 running on Linux x86_64 4.15.0-55-generic #60 (closed)-Ubuntu SMP Tue Jul 2 18:22:20 UTC 2019 built by make with '--build=x86_64-linux-gnu' '--prefix=/usr' '--includedir=/usr/include' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--sysconfdir=/etc' '--localstatedir=/var' '--disable-silent-rules' '--libdir=/usr/lib/x86_64-linux-gnu' '--libexecdir=/usr/lib/x86_64-linux-gnu' '--disable-maintainer-mode' '--disable-dependency-tracking' '--libdir=/usr/lib/x86_64-linux-gnu' '--sysconfdir=/etc/bind' '--with-python=python3' '--localstatedir=/' '--enable-threads' '--enable-largefile' '--with-libtool' '--enable-shared' '--enable-static' '--with-gost=no' '--with-openssl=/usr' '--with-gssapi=/usr' '--with-libidn2' '--with-libjson=/usr' '--with-lmdb=/usr' '--with-gnu-ld' '--with-geoip2' '--with-atf=no' '--enable-ipv6' '--enable-rrl' '--enable-filter-aaaa' '--disable-native-pkcs11' '--enable-dnstap' 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -fdebug-prefix-map=/build/bind9-uP6eK4/bind9-9.14.4=. -fstack-protector-strong -Wformat -Werror=format-security -fno-strict-aliasing -fno-delete-null-pointer-checks -DNO_VERSION_DATE -DDIG_SIGCHASE' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' compiled by GCC 7.4.0 compiled with OpenSSL version: OpenSSL 1.1.1 11 Sep 2018 linked to OpenSSL version: OpenSSL 1.1.1 11 Sep 2018 compiled with libxml2 version: 2.9.4 linked to libxml2 version: 20904 compiled with libjson-c version: 0.12.1 linked to libjson-c version: 0.12.1 compiled with zlib version: 1.2.11 linked to zlib version: 1.2.11 threads support is enabled
default paths: named configuration: /etc/bind/named.conf rndc configuration: /etc/bind/rndc.conf DNSSEC root key: /etc/bind/bind.keys nsupdate session key: //run/named/session.key named PID file: //run/named/named.pid named lock file: //run/named/named.lock
Steps to reproduce
systemctl status named
What is the current bug behavior?
Aug 13 15:02:06 nstest1 systemd[1]: /lib/systemd/system/named.service:7: Unknown lvalue 'Alias' in section 'Unit'
What is the expected correct behavior?
The Alias should work :-)
Relevant configuration files + fixes
Of course the best fix would be to rename the unit file to bind9.service. Here is another approach:
[Unit]
Description=BIND Domain Name Server
Documentation=man:named(8)
After=network.target
Wants=nss-lookup.target
Before=nss-lookup.target
-Alias=bind9.service
[Service]
EnvironmentFile=-/etc/default/named
ExecStart=/usr/sbin/named -f $OPTIONS
ExecReload=/usr/sbin/rndc reload
ExecStop=/usr/sbin/rndc stop
[Install]
WantedBy=multi-user.target
+Alias=bind9.service