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

change the v2ray dir from /usr/bin/v2ray to /usr/lib/v2ray in the script #1934

Closed
wants to merge 2 commits into from
Closed

Conversation

onequid
Copy link

@onequid onequid commented Oct 9, 2019

感谢v2ray开发者目前所有的付出,很好用,提个想到的鸡毛蒜皮的建议
不影响使用,只是强迫症不舒服

因为好像/usr/bin是不放目录的,感觉放/usr/lib/v2ray比较合适
而且也没有必要放/usr/bin/,不需要命令行执行,对吧?

把脚本改了下,本来放到/usr/bin/v2ray的放到/usr/lib/v2ray/

根据iochen的回复
v2ray.service 添加了StandardOutStandardError

因为看代码会读取geosite.datgeoip.dat,如果需要命令行的话,可能需要添加配置文件或命令行参数

如果考虑兼容更多发行版的自启动可以调研下用cron的可行性

UPDATED: changed v2ray file of systemV.

@onequid onequid changed the title change the v2ray dir from /usr/bin/v2ray to /usr/lib/v2ray in the shell change the v2ray dir from /usr/bin/v2ray to /usr/lib/v2ray in the script Oct 9, 2019
@hlx98007
Copy link

hlx98007 commented Oct 17, 2019

bin就是binary的简写,二进制可执行文件一般都放里面。

我个人的想法是,毕竟不是通过system package manager安装的,理应装到/usr/local/bin下,甚至是/opt下面。

@onequid
Copy link
Author

onequid commented Oct 18, 2019

bin就是binary的简写,二进制可执行文件一般都放里面。

我个人的想法是,毕竟不是通过system package manager安装的,理应装到/usr/local/bin下,甚至是/opt下面。

感谢讨论,你提得几个中,比较喜欢放/opt这个主意。

放在/usr/bin/usr/local/bin有两个疑惑:

  1. 因为放的二进制路径是/usr/bin/v2ray/v2ray,不能在命令行执行,且find /usr/bin/* -type dfind /usr/local/bin/* -type d没有结果,即**/bin按惯例只放可执行文件,而不是目录/可执行的结构;
  2. /usr/lib/usr/share(/usr/local/lib/usr/local/share同理)应该具体放什么,不知道有什么标准,以下找了两个常见点的、都被软链到/usr/bin下的信息
lrwxrwxrwx 1 root    root        /usr/bin/code -> /usr/share/code/bin/code*
lrwxrwxrwx 1 root    root        /usr/bin/pdb3.6 -> ../lib/python3.6/pdb.py*

改了脚本后不在/usr/bin放任何东西,是因为程序默认读取二进制所在目录中的geoip.datgeosite.dat,现在没有配置选型或命令行参数可以自定义这两个.dat文件的位置,软链接(ln -s),试了,没用。觉得把两个.dat后缀的文件放bin下也不合适。

@hlx98007
Copy link

hlx98007 commented Oct 19, 2019

  1. 不能在命令行执行是因为你的环境变量PATH没有包含一些自定义的地址。你的find有问题,不需要星号。

  2. /usr/lib放第三方库,或者纯粹是库,给别的程序调用使用。/usr/share放一些程序调用所需的资源,理论上来讲geoip.dat这些就应该放这里面。

由于v2ray写的时候并没有把这些约定俗成的东西写到代码里面去,所以目前用的就是这样的方式,其实也无伤大雅。作为一个独立程序来说,东西都放一块是合理的。

@onequid
Copy link
Author

onequid commented Oct 19, 2019 via email

@hlx98007
Copy link

考虑到各种一键脚本都可能会用这个脚本作为第一步,所以我不建议做此修改。

@onequid
Copy link
Author

onequid commented Oct 19, 2019 via email

@onequid onequid closed this Oct 19, 2019
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

Successfully merging this pull request may close these issues.

2 participants