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

Installation misconfigured #100

Closed
asterriya opened this issue May 26, 2022 · 5 comments
Closed

Installation misconfigured #100

asterriya opened this issue May 26, 2022 · 5 comments

Comments

@asterriya
Copy link

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.

@loyess
Copy link
Owner

loyess commented May 28, 2022

为什么删除dns选项?

@asterriya
Copy link
Author

为什么删除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.

@loyess
Copy link
Owner

loyess commented May 28, 2022

ss-libev 和 ss-rust 配置文件中 dns 选项 key表示的名字 不一样,ss-libev 是 nameserver,ss-rust 是 dns,为了共用配置文件,于是,取了个巧,直接在ss-rust 启动文件 里面尝试获取 nameserver 的值,获取不到会直接退出,停止启动。这就是为什么你删除了配置文件中的dns选项会不能工作的原因。至于 ss-go2 为什么正常,是因为启动脚本中的它没有用到 dns 选项。

shadowsocks-rust.sh#L74-L89

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
}

shadowsocks-rust.sh#L104-L120

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
}

表现在代码中,也就是上面两段,嗯!!!或许可以做个判断。

@asterriya
Copy link
Author

I'm not a tech guy and prefer automation. So I don't know how to apply all of this stuff.

loyess added a commit that referenced this issue May 28, 2022
@loyess
Copy link
Owner

loyess commented May 28, 2022

应该修复了,你可以试试。

loyess added a commit that referenced this issue May 28, 2022
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