Skip to content
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

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

Open
Originalimoc opened this issue Oct 19, 2024 · 2 comments
Open

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

Originalimoc opened this issue Oct 19, 2024 · 2 comments

Comments

@Originalimoc
Copy link

Originalimoc commented Oct 19, 2024

问题现象

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
Copy link

xueba0458 commented Oct 20, 2024

@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

@Originalimoc
Copy link
Author

仔细看日志里ls -alF返回的权限

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants