info: The following are the actual parameters for the v2ray service startup.
info: Please make sure the configuration file path is correctly set.
# Duplicate this file in the same directory and make your customizes there. Or all changes you made will be lost!
## Refer: https://www.freedesktop.org/software/systemd/man/systemd.unit.html
[Service]
ExecStart=
ExecStart=/usr/local/bin/v2ray -config /usr/local/etc/v2ray/config.json
~~~~~~~~~~~~~~~~ /etc/systemd/system/[email protected]/10-donot_touch_single_conf ~~~~~~~~~~~~~~~~
info: The following are the actual parameters for the v2ray service startup.
info: Please make sure the configuration file path is correctly set.
# Duplicate this file in the same directory and make your customizes there. Or all changes you made will be lost!
## Refer: https://www.freedesktop.org/software/systemd/man/systemd.unit.html
[Service]
ExecStart=
ExecStart=/usr/local/bin/v2ray -config /usr/local/etc/v2ray/%i.json
installed: /usr/local/bin/v2ray
installed: /usr/local/bin/v2ctl
installed: /usr/local/share/v2ray/geoip.dat
installed: /usr/local/share/v2ray/geosite.dat
installed: /usr/local/etc/v2ray/config.json
installed: /var/log/v2ray/
installed: /var/log/v2ray/access.log
installed: /var/log/v2ray/error.log
installed: /etc/systemd/system/v2ray.service
installed: /etc/systemd/system/[email protected]
removed: /tmp/tmp.XooUT11KMA
info: V2Ray v4.28.2 is installed.
You may need to execute a command to remove dependent software: apt remove curl unzip
Please execute the command: systemctl enable v2ray; systemctl start v2ray
Building v2ray.service for domainsocket
mv: missing destination file operand after '/etc/systemd/system/v2ray.service'
Try 'mv --help' for more information.
tls-shunt-proxy is not installed. start installation
https://github.com/liberal-boy/tls-shunt-proxy/releases/download/0.6.1/tls-shunt-proxy-linux-amd64.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 657 100 657 0 0 825 0 --:--:-- --:--:-- --:--:-- 824
100 2917k 100 2917k 0 0 1059k 0 0:00:02 0:00:02 --:--:-- 3239k
Archive: /tmp/tls-shunt-proxy/tls-shunt-proxy.zip
inflating: /usr/local/bin/tls-shunt-proxy
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 494 100 494 0 0 583 0 --:--:-- --:--:-- --:--:-- 584
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 3653 100 3653 0 0 12687 0 --:--:-- --:--:-- --:--:-- 12684
tls-shunt-proxy is installed.
Setting v2Ray
Setting tls-shunt-proxy
Building dummy web site
Activating services
Created symlink /etc/systemd/system/multi-user.target.wants/v2ray.service -> /etc/systemd/system/v2ray.service.
Created symlink /etc/systemd/system/multi-user.target.wants/tls-shunt-proxy.service -> /etc/systemd/system/tls-shunt-proxy.service.
安装 TCP+TLS+WEB 成功!
域名:443
c52fbc29-7460-4050-8d8c-8db5ef3000fc (aid: 0)
root@vultr:~# systemctl start v2ray
Failed to start 2.service: Unit 2.service not found.
日志:
\#systemctl status v2ray
● v2ray.service - V2Ray Service
Loaded: loaded (/etc/systemd/system/v2ray.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/v2ray.service.d
└─10-donot_touch_single_conf.conf
Active: failed (Result: exit-code) since Wed 2020-09-23 13:16:17 UTC; 1min 0s ago
Docs: https://www.v2fly.org/
Process: 3600 ExecStart=/usr/local/bin/v2ray -config /usr/local/etc/v2ray/config.json (code=exited, st
Main PID: 3600 (code=exited, status=255)
Sep 23 13:16:17 vultr.guest systemd[1]: v2ray.service: Main process exited, code=exited, status=255/n/a
Sep 23 13:16:17 vultr.guest systemd[1]: v2ray.service: Unit entered failed state.
Sep 23 13:16:17 vultr.guest systemd[1]: v2ray.service: Failed with result 'exit-code'.
Sep 23 13:16:17 vultr.guest systemd[1]: v2ray.service: Service hold-off time over, scheduling restart.
Sep 23 13:16:17 vultr.guest systemd[1]: Stopped V2Ray Service.
Sep 23 13:16:17 vultr.guest systemd[1]: v2ray.service: Start request repeated too quickly.
Sep 23 13:16:17 vultr.guest systemd[1]: Failed to start V2Ray Service.
Sep 23 13:16:17 vultr.guest systemd[1]: v2ray.service: Unit entered failed state.
Sep 23 13:16:17 vultr.guest systemd[1]: v2ray.service: Failed with result 'exit-code'.
配置文件:
root@vultr:~# cat /usr/local/etc/v2ray/config.json
{
"inbounds": [
{
"protocol": "vmess",
"listen": "127.0.0.1",
"port": 32936,
"settings": {
"clients": [
{
"id": "c52fbc29-7460-4050-8d8c-8db5ef3000fc",
"alterId": 0
}
]
},
"streamSettings": {
"network": "domainsocket",
"dsSettings": {
"path": "/tmp/v2ray-ds/v2ray.sock"
}
},
"sniffing": {
"enabled": true,
"destOverride": [ "http", "tls" ]
}
}
],
"outbounds": [
{
"tag": "direct",
"protocol": "freedom",
"settings": {}
},
{
"tag": "blocked",
"protocol": "blackhole",
"settings": {}
}
],
"routing": {
"domainStrategy": "AsIs",
"rules": [
{
"type": "field",
"ip": [
"geoip:private"
],
"outboundTag": "blocked"
},
{
"type": "field",
"protocol": [
"bittorrent"
],
"outboundTag": "blocked"
}
]
}
}
系统服务文件:
root@vultr:~# cat /etc/systemd/system/v2ray.service
[Unit]
Description=V2Ray Service
Documentation=https://www.v2fly.org/
After=network.target nss-lookup.target
[Service]
User=nobody
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
NoNewPrivileges=true
ExecStart=/usr/local/bin/v2ray -config /usr/local/etc/v2ray/config.json
Restart=on-failure
RestartPreventExitStatus=23
[Install]
WantedBy=multi-user.target