Page 1 of 1

Install Bind9 without chroot

PostPosted: Feb 23rd, '16, 22:37
by xlin
How? I need to run the Samba 4. From this does not find the configuration files from the samba

Re: Install Bind9 without chroot

PostPosted: Feb 23rd, '16, 23:16
by doktor5000
Can you please be a little more verbose? Where's the relation between bind and samba? Is there any error message you get?
And if it's only about the samba configuration files, simply add a bind mount for /etc/samba in the chroot ...

Re: Install Bind9 without chroot

PostPosted: Feb 23rd, '16, 23:36
by xlin
doktor5000 wrote:Can you please be a little more verbose? Where's the relation between bind and samba? Is there any error message you get?
And if it's only about the samba configuration files, simply add a bind mount for /etc/samba in the chroot ...

When you install the samba, it requires file from /usr/local/samba/lib/bind9

To start up a bind, he needed files outside the chroot

vim /etc/named.conf
Code: Select all
include "/usr/local/samba/lib/bind9/blablabla.bla"

Re: Install Bind9 without chroot

PostPosted: Feb 23rd, '16, 23:54
by doktor5000
xlin wrote:When you install the samba, it requires file from /usr/local/samba/lib/bind9

It only requires anything from /usr/local if you compile it yourself, distribution packages don't install anything there.

Did you compile either samba or bind9 yourself?

Re: Install Bind9 without chroot

PostPosted: Feb 23rd, '16, 23:57
by xlin
Compile Samba 4 for themselves because it is not in the repository

Re: Install Bind9 without chroot

PostPosted: Feb 24th, '16, 00:01
by doktor5000
Please next time do not use fullquotes, but only use the Reply function. Greatly improves clarity and reading flow ;)
If you want to know where the chroot happens, take a look at /usr/lib/systemd/system/named.service and the script that enables the chroot /usr/sbin/setup-named-chroot.sh

I still don't understand your issue. You want to compile samba4 and say it needs /usr/local/samba/lib/bind9.
Then you say that you want to include that file in the bind config?

Do you get any actual error message when compiling samba?


And you could simply rebuild the samba4 packages from cauldron under Mageia 5 which is probably easier then building from scratch.

Re: Install Bind9 without chroot

PostPosted: Feb 24th, '16, 00:24
by xlin
doktor5000 wrote:Do you get any actual error message when compiling samba?


vim /etc/named.conf
Code: Select all
options {
        listen-on port 53 { 127.0.0.1; };
        listen-on-v6 port 53 { ::1; };
        directory       "/var/named";
        dump-file       "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";
        allow-query     { localhost; };
        recursion yes;

        dnssec-enable no;
        dnssec-validation no;
        dnssec-lookaside auto;

        /* Path to ISC DLV key */
        bindkeys-file "/etc/named.iscdlv.key";

        managed-keys-directory "/var/named/dynamic";
};

logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};

include "/etc/named.root.key";
include "/usr/local/samba/private/named.conf";


cat /usr/local/samba/private/named.conf
Code: Select all
dlz "AD DNS Zone" {
    # For BIND 9.8.x
    # database "dlopen /usr/local/samba/lib/bind9/dlz_bind9.so";

    # For BIND 9.9.x
    # database "dlopen /usr/local/samba/lib/bind9/dlz_bind9_9.so";

    # For BIND 9.10.x
     database "dlopen /usr/local/samba/lib/bind9/dlz_bind9_10.so";
};


Code: Select all
[root@ad1 private]# systemctl status named.service -l
● named.service - Berkeley Internet Name Domain (DNS)
   Loaded: loaded (/usr/lib/systemd/system/named.service; enabled)
   Active: failed (Result: exit-code) since Ср 2016-02-24 01:23:42 MSK; 8s ago
  Process: 1961 ExecStopPost=/usr/sbin/setup-named-chroot.sh /var/lib/named off (code=exited, status=0/SUCCESS)
  Process: 1956 ExecStop=/bin/sh -c /usr/sbin/rndc stop > /dev/null 2>&1 || /bin/kill -TERM $MAINPID (code=exited, status=0/SUCCESS)
  Process: 1196 ExecStart=/usr/sbin/named -u named -t /var/lib/named $OPTIONS (code=exited, status=0/SUCCESS)
  Process: 2092 ExecStartPre=/usr/sbin/named-checkconf -t /var/lib/named -z /etc/named.conf (code=exited, status=1/FAILURE)
  Process: 2070 ExecStartPre=/usr/sbin/setup-named-chroot.sh /var/lib/named on (code=exited, status=0/SUCCESS)
 Main PID: 1200 (code=exited, status=0/SUCCESS)

фев 24 01:23:42 ad1 named-checkconf[2092]: /etc/named.conf:38: open: /usr/local/samba/private/named.conf: file not found
фев 24 01:23:42 ad1 systemd[1]: named.service: control process exited, code=exited status=1
фев 24 01:23:42 ad1 systemd[1]: Failed to start Berkeley Internet Name Domain (DNS).
фев 24 01:23:42 ad1 systemd[1]: Unit named.service entered failed state.
фев 24 01:23:42 ad1 systemd[1]: named.service failed.

Re: Install Bind9 without chroot

PostPosted: Feb 24th, '16, 00:27
by xlin
doktor5000 wrote:And you could simply rebuild the samba4 packages from cauldron under Mageia 5 which is probably easier then building from scratch.

He's not there

Re: Install Bind9 without chroot

PostPosted: Feb 24th, '16, 00:31
by doktor5000
Then what's this?
Code: Select all
[user@openqa_mga6]─[23:31:05]─[~] urpmq --sources samba
ftp://ftp.snt.utwente.nl/pub/os/linux/mageia/distrib/cauldron/x86_64/media/core/release/samba-4.3.4-4.mga6.x86_64.rpm

Re: Install Bind9 without chroot

PostPosted: Feb 24th, '16, 00:46
by xlin
doktor5000 wrote:Then what's this?
Code: Select all
[user@openqa_mga6]─[23:31:05]─[~] urpmq --sources samba
ftp://ftp.snt.utwente.nl/pub/os/linux/mageia/distrib/cauldron/x86_64/media/core/release/samba-4.3.4-4.mga6.x86_64.rpm

Like it. To rebuild mga 5 and test. Thank you.

Re: Install Bind9 without chroot

PostPosted: Feb 24th, '16, 03:02
by doktor5000