Bind named-chroot startup problem

General support questions
Post Reply
TomekWaw
Posts: 5
Joined: 2020/05/26 12:23:12

Bind named-chroot startup problem

Post by TomekWaw » 2020/12/28 13:41:10

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.

User avatar
TrevorH
Forum Moderator
Posts: 30173
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Bind named-chroot startup problem

Post by TrevorH » 2020/12/28 15:12:05

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.
CentOS 6 died in November 2020 - migrate to a new version!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

TomekWaw
Posts: 5
Joined: 2020/05/26 12:23:12

Re: Bind named-chroot startup problem

Post by TomekWaw » 2020/12/29 14:24:02

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

Post Reply

Return to “CentOS 7 - General Support”