New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] macOS 下 mosdns -s 安装成系统服务因权限问题不启动 #357
Comments
配置文件和mosdns没有问题。 可能是macos系统限制了mosdns。
没有日志文件的写权限? |
运行之前是chmod 777 mosdns的啊🤔 |
我去/Library/LaunchDaemons/看了一眼,那个plist确实是被写入了,我uninstall的话也会被删除。 当我尝试着直接把plist内的指令 说明 |
如果 mosdns 运行了,它一定会向 stdout 写入三条日志(版本号和配置文件位置),然后再去加载配置文件,打开日志文件等等。如果这个时候出错了错误日志仍然会写近 stdout 。 你可以看看 macos 有没有记下 stdout 里的日志。 |
在stdout文件里找到了,每次./mosdns -s start都会先是:
不到一秒之后,在error stdout里就会有这样的输出
我确认了一下,这个配置文件的权限是全开的(所有人都可以读写),仍然会有这样的问题。在start后面加上-dir也是这样,感觉很奇怪。 |
找到原因了,要在系统便好设置的安全性与隐私那里把mosdns的完全磁盘访问权限勾选上。如有可能,可否将这个issue pin一下?感觉之后也会有人遇到类似问题... |
en,我会写在 wiki 里。 |
Bug 描述和复现步骤(必填):
mosdns 的版本号(必填):
v3.8.0-0-g42e20fb
操作系统和 CPU 架构(必填):
macOS amd64
使用的配置文件(必填):
tag: main_server # 服务器插件。接收客户端的请求。
type: server
args:
entry:
- main_sequence
- modify_ttl
server: # 监听以下协议和端口
- protocol: udp
addr: 127.0.0.1:553
- protocol: tcp
addr: 127.0.0.1:553
- protocol: udp
addr: '[::1]:553'
- protocol: tcp
addr: '[::1]:553'
tag: main_sequence
type: sequence
args:
exec:
- if:
- query_is_ad_domain
exec:
- _block_with_nxdomain
- _return
tag: 'mem_cache'
type: 'cache'
args:
size: 1024
tag: 'modify_ttl'
type: 'ttl'
args:
minimal_ttl: 300
maximum_ttl: 3600
tag: forward_local
type: fast_forward
args:
upstream:
- addr: https://1.12.12.12/dns-query
tag: forward_remote
type: fast_forward
args:
upstream:
- addr: https://1.1.1.1/dns-query
tag: query_is_local_domain
type: query_matcher
args:
domain:
- 'ext:./geosite.dat:cn'
tag: query_is_non_local_domain
type: query_matcher
args:
domain:
- 'ext:./geosite.dat:geolocation-!cn'
tag: query_is_ad_domain
type: query_matcher
args:
domain:
- 'ext:./geosite.dat:category-ads-all'
tag: response_has_local_ip
type: response_matcher
args:
ip:
- 'ext:./geoip.dat:cn'
mosdns 的 log 记录:
mosdns未输出任何日志
The text was updated successfully, but these errors were encountered: