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

新版安装脚本安装后用systemctl不能启动,命令行正常。 #59

Closed
AmberisMyShiba opened this issue Aug 18, 2020 · 10 comments

Comments

@AmberisMyShiba
Copy link

AmberisMyShiba commented Aug 18, 2020

最近把v2迁移到新的安装脚本环境中,试着用命令行 test了一下,一切正常。然而用systemctl start/restart 都提示failed to start v2ray service 。用journalctl -u v2ray 也没有发现什么有用的信息。现在暂时用
/usr/local/bin/v2ray -confdir /usr/local/etc/v2ray &
应付着

@IceCodeNew
Copy link
Collaborator

journalctl --boot -u v2ray
V2RAY_LOCATION_ASSET=/usr/local/share/v2ray/ v2ray -test -confdir /usr/local/etc/v2ray/
ls -alF --color=auto /usr/local/etc/v2ray
的输出都发出来看看呢?

@AmberisMyShiba
Copy link
Author

journalctl --boot -u v2ray
V2RAY_LOCATION_ASSET=/usr/local/share/v2ray/ v2ray -test -confdir /usr/local/etc/v2ray/
ls -alF --color=auto /usr/local/etc/v2ray
的输出都发出来看看呢?

#ls -alF --color=auto /usr/local/etc/v2ray

total 48
drwxr-xr-x 2 root staff 4096 Aug 18 02:50 ./
drwxrwsr-x 3 root staff 4096 Aug 18 02:12 ../
-rw-r--r-- 1 root root 99 Aug 18 02:50 00_log.json
-rw-r--r-- 1 root root 3 Aug 18 02:12 01_api.json
-rw-r--r-- 1 root root 3 Aug 18 02:12 02_dns.json
-rw-r--r-- 1 root root 3 Aug 18 02:12 03_routing.json
-rw-r--r-- 1 root root 3 Aug 18 02:12 04_policy.json
-rw-r--r-- 1 root root 3 Aug 18 02:12 05_inbounds.json
-rw-r--r-- 1 root root 3 Aug 18 02:12 06_outbounds.json
-rw-r--r-- 1 root root 3 Aug 18 02:12 07_transport.json
-rw-r--r-- 1 root root 3 Aug 18 02:12 08_stats.json
-rw-r--r-- 1 root root 3 Aug 18 02:12 09_reverse.json
lrwxrwxrwx 1 root root 22 Aug 18 02:36 config.json -> /etc/v2ray/config.json

#V2RAY_LOCATION_ASSET=/usr/local/share/v2ray/ v2ray -test -confdir /usr/local/etc/v2ray/

V2Ray 4.27.0 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.14.6 linux/amd64)
A unified platform for anti-censorship.
2020/08/18 03:05:27 Using confdir from arg: /usr/local/etc/v2ray/
2020/08/18 03:05:27 [Info] v2ray.com/core/common/platform/ctlcmd:
v2ctl> Read config: /usr/local/etc/v2ray/00_log.json
v2ctl> Read config: /usr/local/etc/v2ray/01_api.json
v2ctl> Read config: /usr/local/etc/v2ray/02_dns.json
v2ctl> Read config: /usr/local/etc/v2ray/03_routing.json
v2ctl> Read config: /usr/local/etc/v2ray/04_policy.json
v2ctl> Read config: /usr/local/etc/v2ray/05_inbounds.json
v2ctl> Read config: /usr/local/etc/v2ray/06_outbounds.json
v2ctl> Read config: /usr/local/etc/v2ray/07_transport.json
v2ctl> Read config: /usr/local/etc/v2ray/08_stats.json
v2ctl> Read config: /usr/local/etc/v2ray/09_reverse.json
v2ctl> Read config: /usr/local/etc/v2ray/config.json
Configuration OK.

#journalctl --boot -u v2ray

Aug 18 02:36:22 Prox systemd[1]: Stopping V2Ray Service...
Aug 18 02:36:22 Prox systemd[1]: Stopped V2Ray Service.
Aug 18 02:36:22 Prox systemd[1]: Started V2Ray Service.
Aug 18 02:36:22 Prox v2ray[14042]: V2Ray 4.27.0 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.14.6 linux/
Aug 18 02:36:22 Prox v2ray[14042]: A unified platform for anti-censorship.
Aug 18 02:36:22 Prox v2ray[14042]: 2020/08/18 02:36:22 Using confdir from arg: /usr/local/etc/v2ray/
Aug 18 02:36:22 Prox systemd[1]: v2ray.service: Main process exited, code=exited, status=23/n/a
Aug 18 02:36:22 Prox systemd[1]: v2ray.service: Unit entered failed state.
Aug 18 02:36:22 Prox systemd[1]: v2ray.service: Failed with result 'exit-code'.
Aug 18 02:36:23 Prox systemd[1]: v2ray.service: Service hold-off time over, scheduling restart.
Aug 18 02:36:23 Prox systemd[1]: Stopped V2Ray Service.
Aug 18 02:36:23 Prox systemd[1]: Started V2Ray Service.
Aug 18 02:36:23 Prox v2ray[14051]: V2Ray 4.27.0 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.14.6 linux/
Aug 18 02:36:23 Prox v2ray[14051]: A unified platform for anti-censorship.
Aug 18 02:36:23 Prox v2ray[14051]: 2020/08/18 02:36:23 Using confdir from arg: /usr/local/etc/v2ray/
Aug 18 02:36:23 Prox systemd[1]: v2ray.service: Main process exited, code=exited, status=23/n/a
Aug 18 02:36:23 Prox systemd[1]: v2ray.service: Unit entered failed state.
Aug 18 02:36:23 Prox systemd[1]: v2ray.service: Failed with result 'exit-code'.
Aug 18 02:36:23 Prox systemd[1]: v2ray.service: Service hold-off time over, scheduling restart.
Aug 18 02:36:23 Prox systemd[1]: Stopped V2Ray Service.
Aug 18 02:36:23 Prox systemd[1]: Started V2Ray Service.
Aug 18 02:36:23 Prox v2ray[14060]: V2Ray 4.27.0 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.14.6 linux/
Aug 18 02:36:23 Prox v2ray[14060]: A unified platform for anti-censorship.
Aug 18 02:36:23 Prox v2ray[14060]: 2020/08/18 02:36:23 Using confdir from arg: /usr/local/etc/v2ray/
Aug 18 02:36:23 Prox systemd[1]: v2ray.service: Main process exited, code=exited, status=23/n/a
Aug 18 02:36:23 Prox systemd[1]: v2ray.service: Unit entered failed state.
Aug 18 02:36:23 Prox systemd[1]: v2ray.service: Failed with result 'exit-code'.
Aug 18 02:36:23 Prox systemd[1]: v2ray.service: Service hold-off time over, scheduling restart.
Aug 18 02:36:23 Prox systemd[1]: Stopped V2Ray Service.
Aug 18 02:36:23 Prox systemd[1]: Started V2Ray Service.
Aug 18 02:36:23 Prox v2ray[14069]: V2Ray 4.27.0 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.14.6 linux/
Aug 18 02:36:23 Prox v2ray[14069]: A unified platform for anti-censorship.
Aug 18 02:36:23 Prox v2ray[14069]: 2020/08/18 02:36:23 Using confdir from arg: /usr/local/etc/v2ray/
Aug 18 02:36:23 Prox systemd[1]: v2ray.service: Main process exited, code=exited, status=23/n/a
Aug 18 02:36:23 Prox systemd[1]: v2ray.service: Unit entered failed state.
Aug 18 02:36:23 Prox systemd[1]: v2ray.service: Failed with result 'exit-code'.
Aug 18 02:36:23 Prox systemd[1]: v2ray.service: Service hold-off time over, scheduling restart.
Aug 18 02:36:23 Prox systemd[1]: Stopped V2Ray Service.
Aug 18 02:36:23 Prox systemd[1]: Started V2Ray Service.
Aug 18 02:36:23 Prox v2ray[14078]: V2Ray 4.27.0 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.14.6 linux/
Aug 18 02:36:23 Prox v2ray[14078]: A unified platform for anti-censorship.
Aug 18 02:36:23 Prox v2ray[14078]: 2020/08/18 02:36:23 Using confdir from arg: /usr/local/etc/v2ray/
Aug 18 02:36:23 Prox systemd[1]: v2ray.service: Main process exited, code=exited, status=23/n/a
Aug 18 02:36:23 Prox systemd[1]: v2ray.service: Unit entered failed state.
Aug 18 02:36:23 Prox systemd[1]: v2ray.service: Failed with result 'exit-code'.
Aug 18 02:36:24 Prox systemd[1]: v2ray.service: Service hold-off time over, scheduling restart.
Aug 18 02:36:24 Prox systemd[1]: Stopped V2Ray Service.
Aug 18 02:36:24 Prox systemd[1]: v2ray.service: Start request repeated too quickly.
Aug 18 02:36:24 Prox systemd[1]: Failed to start V2Ray Service.
Aug 18 02:36:24 Prox systemd[1]: v2ray.service: Unit entered failed state.
Aug 18 02:36:24 Prox systemd[1]: v2ray.service: Failed with result 'exit-code'.

@ummmme
Copy link

ummmme commented Aug 18, 2020

你现在用拆分后的配置文件启动的v2ray? 能否发个demo看看

@AmberisMyShiba
Copy link
Author

AmberisMyShiba commented Aug 18, 2020

你现在用拆分后的配置文件启动的v2ray? 能否发个demo看看

我删除了拆分后的配置文件,从原来的单个的配置文件,既/etc/v2ray/config.json做了个软链到/usr/local/etc/v2ray/.而且我试过用拆分后的配置文件进行配置,依然无法用systemctl 启动。现在还是用命令启动到后台。/var/log/v2ray和证书文件的权限问题可以排除,都chown成nobody了问题依旧。

@ummmme
Copy link

ummmme commented Aug 18, 2020

你现在用拆分后的配置文件启动的v2ray? 能否发个demo看看

我删除了拆分后的配置文件,从原来的单个的配置文件,既/etc/v2ray/config.json做了个软链到/usr/local/etc/v2ray/.而且我试过用拆分后的配置文件进行配置,依然无法用systemctl 启动。现在还是用命令启动到后台。/var/log/v2ray和证书文件的权限问题可以排除,都chown成nobody了问题依旧。

同样的问题,我直接改了/etc/systemd/system/v2ray.service

ExecStart=/usr/local/bin/v2ray --config=/etc/v2ray/config.json

@AmberisMyShiba
Copy link
Author

你现在用拆分后的配置文件启动的v2ray? 能否发个demo看看

我删除了拆分后的配置文件,从原来的单个的配置文件,既/etc/v2ray/config.json做了个软链到/usr/local/etc/v2ray/.而且我试过用拆分后的配置文件进行配置,依然无法用systemctl 启动。现在还是用命令启动到后台。/var/log/v2ray和证书文件的权限问题可以排除,都chown成nobody了问题依旧。

同样的问题,我直接改了/etc/systemd/system/v2ray.service

ExecStart=/usr/local/bin/v2ray --config=/etc/v2ray/config.json

你改完就正常了吗?我早已按你的办法改过了,还是老样子。搞不懂了,一个systemd的unit文件到底哪里有问题。我试过用新的安装脚本安装低版本的v2ray,也是一样的问题。

@ummmme
Copy link

ummmme commented Aug 18, 2020

改完要reload一下
image

@AmberisMyShiba
Copy link
Author

改完要reload一下
image

当然daemon-reload过了,否则restart会提示的。我还是手动安装一下吧。新的安装脚本问题比较多,没有原来的go.sh顺利。

@AmberisMyShiba
Copy link
Author

已解决。是证书权限的问题。

@fqx
Copy link

fqx commented Sep 12, 2020

我也遇到类似的问题,证书目录我也改成nobody了还是一样的错误,最后只好把service里面的user改成root就好了😂

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

4 participants