Commit c45c3ed8 authored by Nathaniel Roach's avatar Nathaniel Roach Committed by Thomas Petazzoni
Browse files

bind: Add systemd unit file and install it to run at startup.



The unit file is taken from debian, but tested working.
We'll call it named.service to match the sysV initscript.

Signed-off-by: default avatarNathaniel Roach <nroach44@gmail.com>
Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
parent a5f3db69
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -82,6 +82,15 @@ define BIND_INSTALL_INIT_SYSV
	$(INSTALL) -m 0755 -D package/bind/S81named \
		$(TARGET_DIR)/etc/init.d/S81named
endef
define BIND_INSTALL_INIT_SYSTEMD
	$(INSTALL) -D -m 644 package/bind/named.service \
		$(TARGET_DIR)/usr/lib/systemd/system/named.service

	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants

	ln -sf /usr/lib/systemd/system/named.service \
		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/named.service
endef
else
BIND_POST_INSTALL_TARGET_HOOKS += BIND_TARGET_REMOVE_SERVER
endif
+12 −0
Original line number Diff line number Diff line
[Unit]
Description=BIND Domain Name Server
Documentation=man:named(8)
After=network.target

[Service]
ExecStart=/usr/sbin/named -f -u named
ExecReload=/usr/sbin/rndc reload
ExecStop=/usr/sbin/rndc stop

[Install]
WantedBy=multi-user.target