Closed LexterS999 closed 2 years ago
为什么删除dns选项?
为什么删除dns选项?
Because I use my system resolver instead of public DNS, but even if I don't delete any line inside config, it's stop working after reboot. Reminding: speak about ss-rust with plugins. All other stuff working fine like ss-go2 with plugins or ss-libev with plugins.
ss-libev 和 ss-rust 配置文件中 dns 选项 key表示的名字 不一样,ss-libev 是 nameserver,ss-rust 是 dns,为了共用配置文件,于是,取了个巧,直接在ss-rust 启动文件 里面尝试获取 nameserver 的值,获取不到会直接退出,停止启动。这就是为什么你删除了配置文件中的dns选项会不能工作的原因。至于 ss-go2 为什么正常,是因为启动脚本中的它没有用到 dns 选项。
get_config_args(){
local JsonFilePath=$1
if [ ! -f $JsonFilePath ]; then
echo "$NAME config file $JsonFilePath not found"
exit 1
fi
if [ ! "$(command -v jq)" ]; then
echo "Cannot find dependent package 'jq' Please use yum or apt to install and try again"
exit 1
fi
NameServer=$(cat ${JsonFilePath} | jq -r .nameserver)
[ -z "$NameServer" ] && echo -e "Configuration option 'nameserver' acquisition failed" && exit 1
}
do_start() {
if check_running; then
echo "$NAME (pid $PID) is already running."
return 0
fi
ulimit -n 51200
get_config_args $CONF
nohup $DAEMON -c $CONF --dns $NameServer -vvv > $LOG 2>&1 &
check_pid
echo $get_pid > $PID_FILE
if check_running; then
echo "Starting $NAME success"
else
echo "Starting $NAME failed"
RET_VAL=1
fi
}
表现在代码中,也就是上面两段,嗯!!!或许可以做个判断。
I'm not a tech guy and prefer automation. So I don't know how to apply all of this stuff.
应该修复了,你可以试试。
After install SS-rust with X-ray plugin and deleting DNS option from config file, its stop to work. Trying to reboot and other things, but seems like even reboot doesn't help. Something wrong with compatibility of plugin with rust I suppose. Because SS-Go2 working fine.