sameersbn / docker-bind

Dockerize BIND DNS server with webmin for DNS administration
MIT License
913 stars 333 forks source link

Is there a reason logging is forced to stderr in entrypoint.sh #54

Closed workdvdh closed 5 years ago

workdvdh commented 6 years ago

Hi I'm trying to configure logging to a mounted volume but the daemon is run with -g which forces logging to stderr is it possible to override this?

Thanks.

arnydo commented 6 years ago

I would like to do this as well. How do we go about allowing custom logging to files as well as keep normal logs to stderr. For example, trying to get query logs working..

logging{                                                  
  channel query_log {                                     
    file "/var/lib/bind/autorecon.log" versions 3 size 5m;
    severity debug;                                       
    print-time yes;                                       
    print-severity yes;                                   
    print-category yes;                                   
  };                                                      
  category queries{                                       
    query_log;                                            
  };                                                      
};
workdvdh commented 6 years ago

I think got round this by modifying the file /sbin/entrypoint.sh in the container, changed the line

exec $(which named) -u ${BIND_USER} -g ${EXTRA_ARGS}

to

exec $(which named) -u ${BIND_USER} -f ${EXTRA_ARGS}

i.e. change -g to -f

arnydo commented 6 years ago

@workdvdh I changed mine to this as well right after I made the comment. This seems to work and I have added "Default" logging and "Query" logs to a file. I would like to send the Default logs to stdout but can't seem to get that working now. I have tried:

ln -sf /dev/stdout /var/lib/bind/default.log

but get a "invalid file" error.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.