pymumu / smartdns

A local DNS server to obtain the fastest website IP for the best Internet experience, support DoT, DoH. 一个本地DNS服务器,获取最快的网站IP,获得最佳上网体验,支持DoH,DoT。
https://pymumu.github.io/smartdns/
GNU General Public License v3.0
8.38k stars 1.07k forks source link

Cache file permission set to the cache file's dir #1841

Open Originalimoc opened 2 days ago

Originalimoc commented 2 days ago

问题现象

root@homeserver:/var/cache/debugsm/debugsm/debugsm# ls -alF
total 8
drwxr-xr-x 2 root root 4096 Oct 19 23:59 ./
drwxr-xr-x 3 root root 4096 Oct 19 23:59 ../

root@server:/var/cache/debugsm/debugsm/debugsm# killall smartdns
root@server:/var/cache/debugsm/debugsm/debugsm# smartdns -c /etc/smartdns.conf
root@server:/var/cache/debugsm/debugsm/debugsm# cat /etc/smartdns.conf
rr-ttl-min 10
rr-ttl-max 1200
tcp-idle-time 30
cache-size 10000
user smartdns
log-level error
log-file /var/log/smartdns/error.log
cache-persist yes
cache-file /var/cache/debugsm/debugsm/debugsm/cache

root@homeserver:/var/cache/debugsm/debugsm/debugsm# ls -alF
total 8
drwxr-x--- 2 smartdns smartdns 4096 Oct 19 23:59 ./
drwxr-xr-x 3 root     root     4096 Oct 19 23:59 ../
root@homeserver:/var/cache/debugsm/debugsm/debugsm# cd ..
root@homeserver:/var/cache/debugsm/debugsm# ls -alF
total 12
drwxr-xr-x 3 root     root     4096 Oct 19 23:59 ./
drwxr-xr-x 3 root     root     4096 Oct 19 23:59 ../

drwxr-x--- 2 smartdns smartdns 4096 Oct 19 23:59 debugsm/

固件型号 x86_64 Linux 5.15

运营商 Hybrid upstream

smartdns来源以及版本 Compiled from latest source

重现步骤

Above

上游DNS配置。 NA

访问的域名。 NA

信息收集 Hmmmmm....???

xueba0458 commented 1 day ago

@Originalimoc 你遇到的问题是没有缓存文件吗?那你就是没有仔细文档。如果提示没权限,就touch一个cache,再chmod权限就行了。

设置cache定时保存

为避免cache因为系统或进程复位丢失,可以设置smartdns周期保存cache文件。 cache-checkpoint-time 86400

##############################################

Are you experiencing issues with missing cache files? If so, you might not have read the documentation carefully. If you get a permission denied error, just create a cache file using touch, then change the permissions with chmod.

Setting Cache Auto-Save

To prevent the cache from being lost due to system or process resets, you can configure SmartDNS to periodically save the cache file.
cache-checkpoint-time 86400