Regarding compiling BIND 9.10.3-p4 on a SystemD Distro

Mark Andrews marka at isc.org
Thu Mar 24 00:19:42 UTC 2016


In message <alpine.LSU.2.00.1603231230440.19314 at hermes-2.csi.cam.ac.uk>, Tony Finch writes:
> 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.

Bind forks early because it can't fork on Linux after it has created
any threads.  For every other OS it forks later after doing thread
creation.  On Linux the fork call only forks the thread not the
process.

That said named does wait for the loading to complete before the
parent process exits and its exit status reflects if the load
succeeded or not.  See ns_os_daemonize() and ns_os_started().

Mark

>         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.
> _______________________________________________
> Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from this list
> 
> bind-users mailing list
> bind-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/bind-users
-- 
Mark Andrews, ISC
1 Seymour St., Dundas Valley, NSW 2117, Australia
PHONE: +61 2 9871 4742                 INTERNET: marka at isc.org


More information about the bind-users mailing list