NLnetLabs / unbound

Unbound is a validating, recursive, and caching DNS resolver.
https://nlnetlabs.nl/unbound
BSD 3-Clause "New" or "Revised" License
3.13k stars 359 forks source link

unbound-control reload Doesn't reload settigns related to use-syslog and logfile #640

Open MMarco94 opened 2 years ago

MMarco94 commented 2 years ago

Describe the bug Changing logfile or use-syslog on unbound's config, and then calling unbound-control reload doesn't work; the new setting gets applied only after either a restart or a call to unbound-control log_reopen.

The same also happens if those setting gets changed via unbound-control set_option.

To reproduce Steps to reproduce the behavior:

sudo unbound-control set_option logfile: /tmp/unbound_log_test

Expected behavior Logs get written to /tmp/unbound_log_test. Actual behavior: log location doesn't change.

Workaround Calling unbound-control log_reopen or restarting unbound.

System:

Additional information N/A

MMarco94 commented 2 years ago

I realize it's documented that unbound-control set_option shouldn't work.

However, the same behavior happens when going from logfile and use-syslog (and viceversa) by editing the config and then calling unbound-control reload: nothing happens until unbound-control log_reopen is called

JiangHeng12138 commented 2 years ago

unbound-control reload will reopen logfile when use-syslog set to 0. However, I encountered a problem. The logfile failed to be opened, and errno was 13 (Permission denied). Even though I changed the owner group of the logfile to unbound.

JiangHeng12138 commented 2 years ago

Do not add the -d when execute unbound. The above error will be not reported.

jtmyd-top commented 2 years ago

为什么termux中启动一直报错 image

jtmyd-top commented 2 years ago

在termux中安装了unbound,pkg install unbound 并且正确配置了unbound.conf文件但是无法启动如上个评论所示 同时也获取了root权限