v2ray-core icon indicating copy to clipboard operation
v2ray-core copied to clipboard

/usr/local/sbin/v2ray: No such file or directory

Open mahmoodn opened this issue 3 years ago • 2 comments

I used the following commands to fetch/install/enable v2ray

# bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh)
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 22279  100 22279    0     0  77827      0 --:--:-- --:--:-- --:--:-- 77898
info: Installing V2Ray v5.1.0 for x86_64
Downloading V2Ray archive: https://github.com/v2fly/v2ray-core/releases/download/v5.1.0/v2ray-linux-64.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:03 --:--:--     0
100 10.5M  100 10.5M    0     0  3200k      0  0:00:03  0:00:03 --:--:-- 3200k
Downloading verification file for V2Ray archive: https://github.com/v2fly/v2ray-core/releases/download/v5.1.0/v2ray-linux-64.zip.dgst
info: Extract the V2Ray package to /tmp/tmp.MROOoqfsM5 and prepare it for installation.
info: Systemd service files have been installed successfully!
warning: The following are the actual parameters for the v2ray service startup.
warning: Please make sure the configuration file path is correctly set.
# /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 run -config /usr/local/etc/v2ray/config.json
Restart=on-failure
RestartPreventExitStatus=23

[Install]
WantedBy=multi-user.target

# /etc/systemd/system/v2ray.service.d/10-donot_touch_single_conf.conf
# In case you have a good reason to do so, 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 run -config /usr/local/etc/v2ray/config.json

installed: /usr/local/bin/v2ray
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.MROOoqfsM5
info: V2Ray v5.1.0 is installed.
You may need to execute a command to remove dependent software: apt purge curl unzip
Please execute the command: systemctl enable v2ray; systemctl start v2ray


# systemctl enable v2ray; systemctl start v2ray
Synchronizing state of v2ray.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable v2ray
Created symlink /etc/systemd/system/multi-user.target.wants/v2ray.service → /etc/systemd/system/v2ray.service.

As you can see, the status of v2ray is running, but the link and qr command don't work

# 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: active (running) since Mon 2022-10-24 20:57:22 CST; 31s ago

# v2ray link
bash: /usr/local/sbin/v2ray: No such file or directory



Any idea on how to fix that?

mahmoodn avatar Oct 24 '22 13:10 mahmoodn

chmod 777 /var/log/v2ray

winds365 avatar Oct 25 '22 06:10 winds365

# chmod 777 /var/log/v2ray
# ls -l /var/log/v2ray
total 0
-rw------- 1 nobody nogroup 0 Oct 24 20:57 access.log
-rw------- 1 nobody nogroup 0 Oct 24 20:57 error.log
# v2ray qr
v2ray qr: unknown command
Run 'v2ray help' for usage.
# v2ray help
A unified platform for anti-censorship.

Usage:

	v2ray <command> [arguments]

The commands are:

	run           run V2Ray with config
	api           call V2Ray API
	convert       convert config files
	test          test config files
	tls           TLS tools
	uuid          generate new UUID
	verify        verify if a binary is officially signed
	version       print V2Ray version

Use "v2ray help <command>" for more information about a command.

Additional help topics:

	config-merge  config merge logic
	format-loader config formats and loading

Use "v2ray help <topic>" for more information about that topic.

# v2ray version
V2Ray 5.1.0 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.19 linux/amd64)
A unified platform for anti-censorship.
# which v2ray
/usr/local/bin/v2ray

mahmoodn avatar Oct 25 '22 07:10 mahmoodn

I think it is fixed now.

AkinoKaede avatar Dec 24 '22 08:12 AkinoKaede

在容器中查看 v2ray的路径:,添加真实地址链接到设置的/usr/local/bin/v2ray ~ # which v2ray /usr/bin/v2ray ~ # ln -s /usr/bin/v2ray /usr/local/bin/v2ray

18190684376 avatar Jan 15 '24 10:01 18190684376