To be completely clear, changing the service type to "forking" will
tell systemd that the process will daemonize itself, and removing the
"-f" will tell bind9 to daemonize itself. Bind9 will daemonize itself
_when it is ready_.
Thus, you will even see configuration errors that you would otherwise
miss if if they would occur several seconds after startup.
diff -rupN a/lib/systemd/system/bind9.service b/lib/systemd/system/bind9.service
--- a/lib/systemd/system/bind9.service	2018-03-23 00:09:58.000000000 +0100
+++ b/lib/systemd/system/bind9.service	2018-06-04 23:11:36.504356488 +0200
@@ -6,8 +6,10 @@ Wants=nss-lookup.target
 Before=nss-lookup.target
 
 [Service]
+Type=forking
+PIDFile=/run/named/named.pid
 EnvironmentFile=/etc/default/bind9
-ExecStart=/usr/sbin/named -f $OPTIONS
+ExecStart=/usr/sbin/named $OPTIONS
 ExecReload=/usr/sbin/rndc reload
 ExecStop=/usr/sbin/rndc stop
 

Reply via email to