isc_stdio_open '/var/log/bind9/query.log' failed: permission denied

12,493

Solution 1

On /etc/apparmor.d/usr.sbin.named

/var/log/named/** rw,
/var/log/named/ rw,

You must adjust permissions or dir here.

Some people like to put logs in /var/log/named/ instead of having syslog do the heavy lifting.

Solution 2

I tried to configure custom logging, "/var/log/named/log.files.names".

I tried everything that seamed reasonable to get rid of the error, "isc_file_isplainfile '/var/log/named/default' failed: permission denied" by changing the file system permissions without success. I then tried to make the named log files and directory executable and couldn't believe it, that fixed the permissions. Apparently bind needs to execute something using these files and/or directory.

owner=root:group=named and permissions are 775.

p.s: Zanna, you should take your own advice about editing other people's posts. Unless you absolutely know what they're trying to say and not thinking you know, even the most minuscule change you make in their grammar can profoundly change the meaning of their post.

Share:
12,493

Related videos on Youtube

Mahesh
Author by

Mahesh

It is me and my sister's child on this photo :)

Updated on September 18, 2022

Comments

  • Mahesh
    Mahesh over 1 year
    /etc/apparmor.d/usr.sbin.named 
    
    /var/log/bind9/** rw,
    /var/log/bind9/ rw,
    
    /etc/bind/named.conf.options
    options {
            directory "/var/cache/bind";
            auth-nxdomain no;
            listen-on-v6 { any; };
            statistics-file "/var/cache/bind/named.stats";
            rrset-order {order cyclic;};
        allow-transfer { 127.0.0.1; };
    };
    logging {
            channel b_query {
                    file "/var/log/bind9/query.log" versions 2 size 1m;
                    print-time yes;
                    severity info;
            };
            category queries { b_query; };
    };
    

    service bind9 status

    isc_stdio_open '/var/log/bind9/query.log' failed: permission denied

    I have already created bind9 in /var/log and added root:bind with permission 755

    I have already restarted apparmor and bind9 Same error. What is wrong ?

  • fosslinux
    fosslinux almost 6 years
    If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From Review
  • David Foerster
    David Foerster almost 6 years
    @ubashu: This looks like an answer to me albeit with a rather unnecessary introduction.
  • Till Kolditz
    Till Kolditz about 4 years
    Thanks! This saved my day after upgrading ubuntu on my raspberrypi 2b+ from 18.04.4 xeinal to 20.04 focal