Cache file permission set to the cache file's dir
问题现象
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....???
@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
仔细看日志里ls -alF返回的权限