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

换新安装方式后原兼容ss+v2ray-plugin的配置文件运行不了 #18

Closed
nikolawei opened this issue Jun 22, 2020 · 2 comments
Closed

Comments

@nikolawei
Copy link

原来使用go.sh的时候同样的配置是可以运行的,换成新脚本安装后就不行了,systemctl status v2ray显示如下:

v2ray.service - V2Ray Service
   Loaded: loaded (/etc/systemd/system/v2ray.service; disabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2020-06-22 06:20:39 UTC; 621ms ago
  Process: 2513 ExecStart=/usr/local/bin/v2ray -confdir /usr/local/etc/v2ray/ (code=exit
 Main PID: 2513 (code=exited, status=255/EXCEPTION)

Jun 22 06:20:39 test systemd[1]: v2ray.service: Main process exited, code=exited, status
Jun 22 06:20:39 test systemd[1]: v2ray.service: Failed with result 'exit-code'.
Jun 22 06:20:39 test systemd[1]: v2ray.service: Service RestartSec=100ms expired, schedu
Jun 22 06:20:39 test systemd[1]: v2ray.service: Scheduled restart job, restart counter i
Jun 22 06:20:39 test systemd[1]: Stopped V2Ray Service.
Jun 22 06:20:39 test systemd[1]: v2ray.service: Start request repeated too quickly.
Jun 22 06:20:39 test systemd[1]: v2ray.service: Failed with result 'exit-code'.
Jun 22 06:20:39 test systemd[1]: Failed to start V2Ray Service.

我的config如下:

{
  "log" : {
    "access": "/var/log/v2ray/access.log",
    "error": "/var/log/v2ray/error.log",
    "loglevel": "warning"
  },
  "inbounds": [{
    "port": 51515,
    "listen": "127.0.0.1",
    "protocol": "vmess",
    "settings": {
      "clients": [
        {
          "id": "uuid",
          "level": 1,
          "alterId": 64
        }
      ]
    },
    "streamSettings":{
      "network": "ws",
      "wsSettings": {
           "path": "/forv2r"
      }
    }
  },
  {
    "port": "51516",
    "listen": "127.0.0.1",
    "protocol": "dokodemo-door",
    "tag": "ssvr",
    "settings": {
      "address": "v1.mux.cool",
      "followRedirect": false,
      "network": "tcp"
    },
    "streamSettings": {
      "network": "ws",
      "wsSettings": {
      "path": "/forss"
      }
    }
  },
  {
    "port": 9015,
    "protocol": "shadowsocks",
    "settings": {
      "method": "aes-256-gcm",
      "ota": false,
      "password": "123456",
      "network": "tcp,udp"
    },
    "streamSettings": {
      "network": "domainsocket"
    }
  }],
  "outbounds": [{
      "protocol": "freedom",
      "settings": {},
      "tag": "direct"
    },
    {
      "protocol": "blackhole",
      "settings": {},
      "tag": "blocked"
    },
    {
      "protocol": "freedom",
      "tag": "ss",
      "streamSettings": {
        "network": "domainsocket"
      }
    }
  ],
  "transport": {
    "dsSettings": {
      "path": "/var/run/ss-loop.sock"
    }
  },
  "routing": {
    "rules": [
      {
        "type": "field",
        "inboundTag": [
          "ssvr"
        ],
        "outboundTag": "ss"
      },
      {
        "type": "field",
        "ip": [
          "geoip:private"
        ],
        "outboundTag": "blocked"
      }
    ]
  }
}

前面套了nginx,不同域名可以对应使用v2ray和ss+plugin客户端。
已经试过4.25.0版本下,使用go.sh安装是可以运行的,使用fhs安装就会出现开头的情况

@IceCodeNew
Copy link
Collaborator

IceCodeNew commented Jun 22, 2020

Process: 2513 ExecStart=/usr/local/bin/v2ray -confdir /usr/local/etc/v2ray/ (code=exit

看到这里的 -confdir 了么,确保目录 /usr/local/etc/v2ray/ 下只有你之前的配置文件,如果还有脚本自动产生的多配置文件,删掉它们,或者重命名到不是以 .json 结尾。

上面这个问题是最可能的情况,如果不是,运行 journalctl --boot -u v2ray ls -alF /usr/local/etc/v2ray/ ls -alF /usr/local/lib/v2ray/,把结果 脱敏 以后发上来。

@nikolawei
Copy link
Author

Process: 2513 ExecStart=/usr/local/bin/v2ray -confdir /usr/local/etc/v2ray/ (code=exit

看到这里的 -confdir 了么,确保目录 /usr/local/etc/v2ray/ 下只有你之前的配置文件,如果还有脚本自动产生的多配置文件,删掉它们,或者重命名到不是以 .json 结尾。

上面这个问题是最可能的情况,如果不是,运行 journalctl --boot -u v2ray ls -alF /usr/local/etc/v2ray/ ls -alF /usr/local/lib/v2ray/,把结果 脱敏 以后发上来。

大概已经找到问题所在了,新加入的多文件配置功能,inbound或outbound下的数组多于1的话,每个数组都一定要有"tag"不会被替代掉,不然就会产生问题。

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