Since there are BIND packages (9.9.4) for RHEL7/CentOS7 available from default 
repositories you could download those packages and extract the systemd files 
from them and examine what they've done.

With systemd the methodology isn't that BIND notifies other things that it is 
up.  It is that other things, if dependent upon BIND, have in their systemd 
files a requirement that BIND be up before they start. 

That is different than Sys V init in which things started one after the other.  
 The idea is a systemd boot is much faster as it doesn't make things wait 
because of order but rather only where there are dependencies.

Also as an FYI Carl Byington regularly post new builds he has done of BIND 
updates for RHEL/CentOS.  
The most recent email he sent was for BIND 9.10 and has a link to:
http://www.five-ten-sg.com/mapper/bind

I haven't used that myself but it probably also contains systemd examples you 
could extract.

-----Original Message-----
From: bind-users-boun...@lists.isc.org 
[mailto:bind-users-boun...@lists.isc.org] On Behalf Of Tony Finch
Sent: Wednesday, March 23, 2016 8:36 AM
To: Reindl Harald
Cc: bind-users@lists.isc.org
Subject: Re: Regarding compiling BIND 9.10.3-p4 on a SystemD Distro

Reindl Harald <h.rei...@thelounge.net> wrote:
>
> > The problem that I alluded to above is that if you have services 
> > that depend on the DNS, there should be a mechanism for the DNS 
> > server to say when it is ready and that it's OK to start services 
> > that need DNS. I don't know the right way to specify that to 
> > systemd: maybe it needs a socket unit file as well?
>
> or just don't use "-f" and Type=forking
>
> https://www.freedesktop.org/software/systemd/man/systemd.service.html
>
> If set to forking, it is expected that the process configured with 
> ExecStart= will call fork() as part of its start-up. The parent 
> process is expected to exit when start-up is complete and all communication 
> channels are set up.

BIND does not do that - it forks too early. It's a bit tiresome.

        log_daemon_msg "Starting name server" "BIND"
        start-stop-daemon --start --oknodo --pidfile $PIDFILE \
                --name named --user named --group named \
                --startas $TOP/bin/named \
                -- -t $TOP -u named -c /etc/named.conf
        i=$(( $? ? 100 : 0 ))
        while   [ $i -lt 100 ] &&
                ! rndc status >/dev/null 2>&1
        do      sleep 0.1
                i=$((i+1))
        done
        chmod g+r $RUN/session.key
        rndc status >/dev/null 2>&1
        log_end_msg $?

Tony.
--
f.anthony.n.finch  <d...@dotat.at>  http://dotat.at/  -  I xn--zr8h punycode 
Fair Isle, Faeroes: South or southwest 5 or 6, occasionally 7 later. Moderate 
or rough, occasionally very rough. Rain or showers. Moderate or good, 
occasionally poor.
_______________________________________________
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe 
from this list

bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users
_______________________________________________
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe 
from this list

bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users

Reply via email to