Page 1 of 1

[SOLVED] update named.conf for BIND with chroot/systemd

PostPosted: Dec 9th, '13, 04:37
by linuxdad
I am updating the /etc/named.conf for BIND. I can edit the file /etc/named.conf, but the systemctl daemon wants the //var/lib/named/etc/named.conf updated, but this is a read only filesystem.

How do I update the named.conf and make systemctl work with the daemon. Thank you.

Re: How to update systemctl for BIND?

PostPosted: Dec 9th, '13, 14:33
by doktor5000
Now, with the other systemd threads you put up in mind, first things first: What do you want to achieve in particular?
You want to run a local bind server? What for? Maybe a local caching server is enough?

Can you show some log excerpts of "systemctl daemon wants the //var/lib/named/etc/named.conf updated" and why is /var/lib a readonly filesystem?

Re: How to update systemctl for BIND?

PostPosted: Dec 9th, '13, 14:54
by linuxdad
OK, Doctor, thanks for your response.

I am running BIND, because I host a few domains (right now about 135). I've been doing this for a little while (since 1993).

I normally have a recipe on updating the configuration of Bind to support the definition of the domains which I am hosting, because the master and slave information are defined in the /etc/named.conf file (or in this case the chroo ted version being in /var/lib/named/etc/named.conf).

When I start the named service, I see the following:

Code: Select all
[root@ns ~]# service named restart
Redirecting to /bin/systemctl restart named.service
Job for named.service failed. See 'systemctl status named.service' and 'journalctl -n' for details.

[root@ns ~]# systemctl status named.service
named.service - Berkeley Internet Name Domain (DNS)
Loaded: loaded (/usr/lib/systemd/system/named.service; enabled)
Active: failed (Result: exit-code) since Mon, 2013-12-09 07:48:17 EST; 1min 59s ago
Process: 2492 ExecStartPre=/usr/sbin/named-checkconf -t /var/lib/named -z /etc/named.conf (code=exited, status=1/FAILURE)
Process: 2471 ExecStartPre=/usr/sbin/setup-named-chroot.sh /var/lib/named on (code=exited, status=0/SUCCESS)
CGroup: name=systemd:/system/named.service

Dec 09 07:48:17 ns.IT-Security-inc.com named-checkconf[2492]: /etc/named.conf:51: 'logging' redefined near 'logging'
Dec 09 07:48:17 ns.IT-Security-inc.com systemd[1]: Failed to start Berkeley Internet Name Domain (DNS).
Dec 09 07:48:17 ns.IT-Security-inc.com systemd[1]: Unit named.service entered failed state


I have updated the /etc/named.conf file, but another version is put into the /var/lib/named/etc/named.conf, as follows:

Code: Select all
[root@ns ~]# diff /etc/named.conf /var/lib/named/etc/named.conf
51,56c51,56
< //logging {
< //        channel default_debug {
< //                file "data/named.run";
< //                severity dynamic;
< //        };
< //};
---
> logging {
>         channel default_debug {
>                 file "data/named.run";
>                 severity dynamic;
>         };
> };


Attempting to update the chrooted version of named proceeds as follows:
Code: Select all
[root@ns ~]# cp /etc/named.conf /var/lib/named/etc/named.conf
cp: overwrite â/var/lib/named/etc/named.confâ? y
cp: cannot create regular file â/var/lib/named/etc/named.confâ: Read-only file system



This is what I am trying to resolve. I can work through the updates, but how do I get the update over to the chrooted, read-only filesystem on Mageia?

Thank you.,

Re: How to update systemctl for BIND?

PostPosted: Dec 9th, '13, 15:21
by doktor5000
Sorry, tried to reproduce this but here it works just fine. After installation of bind and no configuration:

Code: Select all
[doktor5000@Mageia3 SRPMS]$ sudo systemctl start bind.service
Failed to issue method call: Unit bind.service failed to load: No such file or directory. See system logs and 'systemctl status bind.service' for details.
[doktor5000@Mageia3 SRPMS]$ sudo systemctl start named.service
[doktor5000@Mageia3 SRPMS]$ sudo systemctl status named.service
named.service - Berkeley Internet Name Domain (DNS)
          Loaded: loaded (/usr/lib/systemd/system/named.service; enabled)
          Active: active (running) since Mon, 2013-12-09 14:14:09 CET; 6s ago
         Process: 4395 ExecStart=/usr/sbin/named -u named -t /var/lib/named $OPTIONS (code=exited, status=0/SUCCESS)
         Process: 4392 ExecStartPre=/usr/sbin/named-checkconf -t /var/lib/named -z /etc/named.conf (code=exited, status=0/SUCCESS)
         Process: 4362 ExecStartPre=/usr/sbin/setup-named-chroot.sh /var/lib/named on (code=exited, status=0/SUCCESS)
        Main PID: 4396 (named)
          CGroup: name=systemd:/system/named.service
                  └ 4396 /usr/sbin/named -u named -t /var/lib/named

Dec 09 14:14:09 Mageia3 named[4396]: using pre-chroot entropy source /dev/urandom
Dec 09 14:14:09 Mageia3 named[4396]: managed-keys-zone: loaded serial 0
Dec 09 14:14:09 Mageia3 named[4396]: zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0
Dec 09 14:14:09 Mageia3 named[4396]: zone localhost.localdomain/IN: loaded serial 0
Dec 09 14:14:09 Mageia3 named[4396]: zone 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa/IN: loaded serial 0
Dec 09 14:14:09 Mageia3 named[4396]: zone localhost/IN: loaded serial 0
Dec 09 14:14:09 Mageia3 named[4396]: zone 0.in-addr.arpa/IN: loaded serial 0
Dec 09 14:14:09 Mageia3 named[4396]: all zones loaded
Dec 09 14:14:09 Mageia3 named[4396]: running
Dec 09 14:14:09 Mageia3 systemd[1]: Started Berkeley Internet Name Domain (DNS).

[doktor5000@Mageia3 SRPMS]$ diff -u /etc/named.conf /var/lib/named/etc/named.conf
[doktor5000@Mageia3 SRPMS]$


stopped it again to unmount the chroot and edited /etc/named.conf and uncommented logging as in your example:
Code: Select all
[doktor5000@Mageia3 SRPMS]$ sudo systemctl stop named.service
[doktor5000@Mageia3 SRPMS]$ sudo vi /etc/named.conf
[doktor5000@Mageia3 SRPMS]$ grep -A6 logging /etc/named.conf
//logging {
//        channel default_debug {
//                file "data/named.run";
//                severity dynamic;
//        };
//};

[doktor5000@Mageia3 SRPMS]$


started it again, and compared both configuration files, both are the same as expected:
Code: Select all
[doktor5000@Mageia3 SRPMS]$ sudo systemctl start named.service
[doktor5000@Mageia3 SRPMS]$ sudo systemctl status named.service
named.service - Berkeley Internet Name Domain (DNS)
          Loaded: loaded (/usr/lib/systemd/system/named.service; enabled)
          Active: active (running) since Mon, 2013-12-09 14:16:34 CET; 4s ago
         Process: 4791 ExecStopPost=/usr/sbin/setup-named-chroot.sh /var/lib/named off (code=exited, status=0/SUCCESS)
         Process: 4782 ExecStop=/bin/sh -c /usr/sbin/rndc stop > /dev/null 2>&1 || /bin/kill -TERM $MAINPID (code=exited, status=0/SUCCESS)
         Process: 4999 ExecStart=/usr/sbin/named -u named -t /var/lib/named $OPTIONS (code=exited, status=0/SUCCESS)
         Process: 4996 ExecStartPre=/usr/sbin/named-checkconf -t /var/lib/named -z /etc/named.conf (code=exited, status=0/SUCCESS)
         Process: 4965 ExecStartPre=/usr/sbin/setup-named-chroot.sh /var/lib/named on (code=exited, status=0/SUCCESS)
        Main PID: 5000 (named)
          CGroup: name=systemd:/system/named.service
                  └ 5000 /usr/sbin/named -u named -t /var/lib/named

Dec 09 14:16:34 Mageia3 named[5000]: managed-keys-zone: journal file is out of date: removing journal file
Dec 09 14:16:34 Mageia3 named[5000]: managed-keys-zone: loaded serial 3
Dec 09 14:16:34 Mageia3 named[5000]: zone 0.in-addr.arpa/IN: loaded serial 0
Dec 09 14:16:34 Mageia3 named[5000]: zone localhost/IN: loaded serial 0
Dec 09 14:16:34 Mageia3 named[5000]: zone 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa/IN: loaded serial 0
Dec 09 14:16:34 Mageia3 named[5000]: zone localhost.localdomain/IN: loaded serial 0
Dec 09 14:16:34 Mageia3 named[5000]: zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0
Dec 09 14:16:34 Mageia3 named[5000]: all zones loaded
Dec 09 14:16:34 Mageia3 systemd[1]: Started Berkeley Internet Name Domain (DNS).
Dec 09 14:16:34 Mageia3 named[5000]: running
[doktor5000@Mageia3 SRPMS]$ diff -u /etc/named.conf /var/lib/named/etc/named.conf
[doktor5000@Mageia3 SRPMS]$

Re: update named.conf for BIND with chroot/systemd

PostPosted: Dec 9th, '13, 15:28
by linuxdad
Hmm, I am completely confused now.

But I think that I have found the problem.

Code: Select all
[root@ns ~]# df
df: â/var/lib/named/etc/named.conf (deleted)â: No such file or directory
Filesystem                                    Size  Used Avail Use% Mounted on
rootfs                                        4.5G  285M  4.0G   7% /
devtmpfs                                      4.0G     0  4.0G   0% /dev
tmpfs                                         4.0G   84K  4.0G   1% /dev/shm
tmpfs                                         4.0G  684K  4.0G   1% /run
/dev/sda1                                     4.5G  285M  4.0G   7% /
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr
tmpfs                                         4.0G     0  4.0G   0% /sys/fs/cgroup
/dev/sda7                                      16G  715M   14G   5% /var
/dev/sda8                                     4.4G  9.3M  4.2G   1% /tmp
ns5.gigabit.ABS-CompTech.com:/sysadm           32G  3.7G   27G  13% /sysadm
ns5.gigabit.ABS-CompTech.com:/var/spool/mail   11G  1.8G  8.5G  18% /mail/spool/mail
ns5.gigabit.ABS-CompTech.com:/home             44G   22G   23G  49% /home
/dev/sda1                                     4.5G  285M  4.0G   7% /var/lib/named/etc/rndc.key
/dev/sda1                                     4.5G  285M  4.0G   7% /var/lib/named/etc/named.iscdlv.key
/dev/sda1                                     4.5G  285M  4.0G   7% /var/lib/named/etc/named.root.key
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/openssl
/dev/sda7                                      16G  715M   14G   5% /var/lib/named/var/named
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr/lib/bind
[root@ns ~]#


The big question is, how on earth did this happen?

Re: update named.conf for BIND with chroot/systemd

PostPosted: Dec 9th, '13, 15:35
by linuxdad
After unmounting the un-necessary mount points, I am presented with:

Code: Select all
df: â/var/lib/named/etc/named.conf (deleted)â: No such file or directory
Filesystem                                    Size  Used Avail Use% Mounted on
rootfs                                        4.5G  285M  4.0G   7% /
devtmpfs                                      4.0G     0  4.0G   0% /dev
tmpfs                                         4.0G   84K  4.0G   1% /dev/shm
tmpfs                                         4.0G  684K  4.0G   1% /run
/dev/sda1                                     4.5G  285M  4.0G   7% /
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr
tmpfs                                         4.0G     0  4.0G   0% /sys/fs/cgroup
/dev/sda7                                      16G  716M   14G   5% /var
/dev/sda8                                     4.4G  9.3M  4.2G   1% /tmp
ns5.gigabit.ABS-CompTech.com:/sysadm           32G  3.7G   27G  13% /sysadm
ns5.gigabit.ABS-CompTech.com:/var/spool/mail   11G  1.8G  8.5G  18% /mail/spool/mail
ns5.gigabit.ABS-CompTech.com:/home             44G   22G   23G  49% /home
/dev/sda1                                     4.5G  285M  4.0G   7% /var/lib/named/etc/rndc.key
/dev/sda1                                     4.5G  285M  4.0G   7% /var/lib/named/etc/named.iscdlv.key
/dev/sda1                                     4.5G  285M  4.0G   7% /var/lib/named/etc/named.root.key
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/openssl
/dev/sda7                                      16G  716M   14G   5% /var/lib/named/var/named

Code: Select all
[root@ns ~]# service named stop
Redirecting to /bin/systemctl stop named.service

Code: Select all
[root@ns ~]# df
df: â/var/lib/named/etc/named.conf (deleted)â: No such file or directory
Filesystem                                    Size  Used Avail Use% Mounted on
rootfs                                        4.5G  285M  4.0G   7% /
devtmpfs                                      4.0G     0  4.0G   0% /dev
tmpfs                                         4.0G   84K  4.0G   1% /dev/shm
tmpfs                                         4.0G  684K  4.0G   1% /run
/dev/sda1                                     4.5G  285M  4.0G   7% /
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr
tmpfs                                         4.0G     0  4.0G   0% /sys/fs/cgroup
/dev/sda7                                      16G  716M   14G   5% /var
/dev/sda8                                     4.4G  9.3M  4.2G   1% /tmp
ns5.gigabit.ABS-CompTech.com:/sysadm           32G  3.7G   27G  13% /sysadm
ns5.gigabit.ABS-CompTech.com:/var/spool/mail   11G  1.8G  8.5G  18% /mail/spool/mail
ns5.gigabit.ABS-CompTech.com:/home             44G   22G   23G  49% /home
/dev/sda1                                     4.5G  285M  4.0G   7% /var/lib/named/etc/rndc.key
/dev/sda1                                     4.5G  285M  4.0G   7% /var/lib/named/etc/named.iscdlv.key
/dev/sda1                                     4.5G  285M  4.0G   7% /var/lib/named/etc/named.root.key
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/bind
/dev/sda6                                     7.6G  3.9G  3.4G  54% /var/lib/named/usr/lib/openssl
/dev/sda7                                      16G  716M   14G   5% /var/lib/named/var/named

Code: Select all
[root@ns ~]# umount /var/lib/named/etc/rndc.key /var/lib/named/etc/named.iscdlv.key /var/lib/named/etc/named.root.key /var/lib/named/usr/lib/bind /var/lib/named/usr/lib/openssl /var/lib/named/var/named
[root@ns ~]# df
df: â/var/lib/named/etc/named.conf (deleted)â: No such file or directory
Filesystem                                    Size  Used Avail Use% Mounted on
rootfs                                        4.5G  285M  4.0G   7% /
devtmpfs                                      4.0G     0  4.0G   0% /dev
tmpfs                                         4.0G   84K  4.0G   1% /dev/shm
tmpfs                                         4.0G  684K  4.0G   1% /run
/dev/sda1                                     4.5G  285M  4.0G   7% /
/dev/sda6                                     7.6G  3.9G  3.4G  54% /usr
tmpfs                                         4.0G     0  4.0G   0% /sys/fs/cgroup
/dev/sda7                                      16G  716M   14G   5% /var
/dev/sda8                                     4.4G  9.3M  4.2G   1% /tmp
ns5.gigabit.ABS-CompTech.com:/sysadm           32G  3.7G   27G  13% /sysadm
ns5.gigabit.ABS-CompTech.com:/var/spool/mail   11G  1.8G  8.5G  18% /mail/spool/mail
ns5.gigabit.ABS-CompTech.com:/home             44G   22G   23G  49% /home
[root@ns ~]#
[root@ns ~]#


Yet I still cannot update the /etc/named.conf file for the chrooted directory. (and why is df reporting:

df: â/var/lib/named/etc/named.conf (deleted)â: No such file or directory

This is so unnatural for a Linux distribution behavior. I still do not understand what is blocking named.conf.

Re: update named.conf for BIND with chroot/systemd

PostPosted: Dec 9th, '13, 15:36
by doktor5000
Please next time use code tags as explained in ftp://ftp5.gwdg.de/pub/linux/mandriva/m ... e_tags.ogv

As I don't know what you did previous to this, seems like the chroot has been overmounted quite a few times.
What did you do? Even when I'm using service named reload or restart cannot reproduce this behaviour.

You could take a look at the command you've used and the content of the system named service file and the chroot script:

Code: Select all
/usr/lib/systemd/system/named.service
/usr/sbin/setup-named-chroot.sh



PS:
As you got quite some issues with systemd and services, maybe this is an issue with your overall system setup or customizations,
like separate mounts or that dedicated /tmpfs thing or something else. You should first check if those issues don't stem from that.

Would be nice if you could open a separate thread for that ...

Re: update named.conf for BIND with chroot/systemd

PostPosted: Dec 9th, '13, 15:47
by linuxdad
Thank you very much!

One down, and more to go!

the section that made the most sense was the /usr/lib/systemd/system/named.service file.

Running the process:

ExecStopPost=/usr/sbin/setup-named-chroot.sh /var/lib/named off

Manually (i.e. /usr/sbin/setup-named-chroot.sh /var/lib/named off), resolved the case of the named.conf file on a read-only filesystem.

Wow, that was painful! Hopefully the rest are simpler from here on in. Thank you again for the advice and information.