v2ray-core: v2ray does not read config.json from a custom path and not from a symlink either
What version of V2Ray are you using?
5.1.0
What’s your scenario of using V2Ray?
I’ve installed v2ray by using the fhs script. Initially I tried to create a symlink to /custom/path/to/config.json from /usr/local/etc/v2ray/config.json, but that didn’t work.
Then I’ve created a override.conf inside the v2ray.service.d directory with below content:
[Service]
User=v2ray_user
ExecStart=
ExecStart=/usr/local/bin/v2ray run -config /custom/path/to/config.json
At first, tried without User=v2ray_user directive but didn’t work. So I created a new linux user, ran chown v2ray_user:v2ray_user config.json. But still I get permission denied:
Failed to start: main/commands: failed to load config: [/custom/path/to/config.json] > fail to load /custom/path/to/config.json: open /custom/path/to/config.json: permission denied
Had the same error with symlinks too. But interestingly, it works if I run v2ray run -config /custom/path/to/config.json in terminal or when I use User=my_own_username directive inside the override.conf
What problems have you encountered?
See above.
What’s your expectation?
I expect to be able to change to a custom path to config.json using symlinks or a .conf drop-in file.
How can one customize the path for config.json file?
Please attach your configuration here
{ can provide if absolutely needed }
Server configuration:
// Please attach your server configuration here.
Client configuration:
// Please attach your client configuration here.
Please attach error logs here
Server error log:
// Please attach your server error log here.
Client error log:
// Please attach your client error log here.
Please attach access log here
// Please attach your server access log here.
Other configurations (such as Nginx) and logs here
If V2Ray cannot start up, please attach output from --test command
If V2Ray service is abnormal, please attach journal log here
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 26 (5 by maintainers)
@a-pav
If you don’t want to compromise the permissions of your home directory, you can use file ACL. No workaround is needed.
Apply this command to all parent directory of
config.json. It is safe and does not affect the permissions of other users.Works fine here. You might have wrong permission for your config file.
You must create a new problem. May you should write a golang program to have a test?
Jan 11, 2023 19:48:02 a-pav @.***>: