fix: Initialize log file permissions

1. It seems that someone will run V2Ray directly through commands instead of systemd first, which will cause wrong Log file permissions and affect subsequent systemd operations.

issue #38
pull/39/head
Dct Mei 2020-08-14 20:58:22 +08:00
parent c5d661fca6
commit 9b090f80f9
No known key found for this signature in database
GPG Key ID: 50BF8B712DCAD7EA
1 changed files with 4 additions and 0 deletions

View File

@ -370,8 +370,12 @@ install_v2ray() {
if [[ ! -d '/var/log/v2ray/' ]]; then
if [[ -n "$(id nobody | grep nogroup)" ]]; then
install -d -m 700 -o nobody -g nogroup /var/log/v2ray/
install -m 600 -o nobody -g nogroup /var/log/v2ray/access.log
install -m 600 -o nobody -g nogroup /var/log/v2ray/error.log
else
install -d -m 700 -o nobody -g nobody /var/log/v2ray/
install -m 600 -o nobody -g nobody /var/log/v2ray/access.log
install -m 600 -o nobody -g nobody /var/log/v2ray/error.log
fi
LOG='1'
fi