Regarding compiling BIND 9.10.3-p4 on a SystemD Distro

Tony Finch dot at dotat.at
Wed Mar 23 12:36:07 UTC 2016


Reindl Harald <h.reindl at 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  <dot at 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.


More information about the bind-users mailing list