Page 1 of 1

Bind named-chroot startup problem

Posted: 2020/12/28 13:41:10
by TomekWaw
I've been running BIND (currently 9.11.4-P2-RedHat-9.11.4-26.P2.el7_9.3) as chroot without problems for many years.

Right now I'm unable to start my named-chroot.

I've narrowed it down to config files not being mounted correctly to /var/named/chroot/etc

named-chroot.service calles to /lib/systemd/system/named-chroot-setup.service.
Content of this file is standard:

Code: Select all

[Unit]
Description=Set-up/destroy chroot environment for named (DNS)
BindsTo=named-chroot.service
Wants=named-setup-rndc.service
After=named-setup-rndc.service


[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/libexec/setup-named-chroot.sh /var/named/chroot on /etc/named-chroot.files
ExecStop=/usr/libexec/setup-named-chroot.sh /var/named/chroot off /etc/named-chroot.files
When I manually execute:
/usr/libexec/setup-named-chroot.sh /var/named/chroot on /etc/named-chroot.files
it mounts without problems.
When I manually execute:
/usr/libexec/setup-named-chroot.sh /var/named/chroot off /etc/named-chroot.files
it unmounts without problems.

But when I call it:
systemctl start named-chroot-setup.service
it mounts all those files for one second only. Then it instantly dismounts them.

And that's the main reason named-bind won't start because it does named-checkconf after they have been dismounted.

Any ideas what could be wrong?
I have another machine with similar setup (secondary nameserver) and no problems there.
I've been trying to detect any configuration differences, but I found none.

2 hours of analysis and still no clues.
Any hints much appreciated.

Re: Bind named-chroot startup problem

Posted: 2020/12/28 15:12:05
by TrevorH
it mounts all those files for one second only. Then it instantly dismounts them.
I've seen that before. Try systemctl daemon-reload. It thinks that whatever is mounted on there does not belong so it umounts it immediately. I'd suspect it says so in /var/log/messages if you need confirmation.

Re: Bind named-chroot startup problem

Posted: 2020/12/29 14:24:02
by TomekWaw
I'm sure I've been issuing this command yesterday and it didn't help.
But I've done it once again today and - surprise - it works now.
It feels a bit uncomfortable to me not to know what exactly has happened but at least it works now
Thank you, TrevorH