Bind9.16.23的工作目录权限问题,导致无法启动Bind服务
1、查看历史记录的变更操作
愫暮 2024/1/23 14:42:18
[root@bind-m-74 named]# history |grep chmod
549 chmod -x root:named /var/named/
664 history |grep chmod
2、查看Bind的默认输出日志文件/var/log/messages,查看是否有报错提示信息。
愫暮 2024/1/23 14:43:55
[root@bind-m-74 named]# tail -f /var/log/messages
Jan 23 14:28:26 web-74 named[2130]: using 2 UDP listeners per interface
Jan 23 14:28:26 web-74 named[2130]: using up to 21000 sockets
Jan 23 14:28:26 web-74 named[2130]: loading configuration from '/etc/named.conf'
Jan 23 14:28:26 web-74 named[2130]: directory '/var/named' is not writable
Jan 23 14:28:26 web-74 named[2130]: /etc/named.conf:13: parsing failed: permission denied
Jan 23 14:28:26 web-74 named[2130]: loading configuration: permission denied
Jan 23 14:28:26 web-74 named[2130]: exiting (due to fatal error)
Jan 23 14:28:26 web-74 systemd[1]: named.service: Control process exited, code=exited, status=1/FAILURE
Jan 23 14:28:26 web-74 systemd[1]: named.service: Failed with result 'exit-code'.
Jan 23 14:28:26 web-74 systemd[1]: Failed to start Berkeley Internet Name Domain (DNS).
3、根据2的日志,发现Bind的主工作目录/var/named的权限有问题。
4、根据1的历史指令,将-x权限重新赋权,然后重启Bind服务即可。
5、查看正常的Bind服务的主目录权限,如下。
[root@hanyw-bind-s ~]# ls -ld /var/named/
drwxrwx--T 5 root named 149 1月 23 16:33 /var/named/