【建议】增加用户级别的 xray.service 支持
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 63/100
Research direction
Read the installation script and find where it creates or installs xray.service and chooses the system service directory. Compare that flow with the user unit example in the issue, including its ~/.config/systemd/user location and systemctl --user commands. Done means the installer supports installing the service for a non-root user while preserving the existing system service path.
Written by the indexing model from the issue text.
Description
目前这个脚本安装的 xray.service 只能安装到系统的 systemctl service 目录,对于不便或者不能使用 root 的场景没有很好的支持,此外在多用户场景下也使得不同用户被迫共享同一个配置文件,体验并不好。
由于 systemd 本身是有运行 user unit 的功能的,因此我在自己的电脑上,通过复制粘贴的方式,写了一个用户级 xray.service 给我自己使用,内容如下:
[Unit]
Description="Xray service (user unit)"
[Service]
ExecStart="%h/GFW/Xray/Xray-linux-64/xray" -c "%h/GFW/Xray/Xray-linux-64/config.json"
Restart=on-failure
RestartPreventExitStatus=23
LimitNPROC=10000
LimitNOFILE=1000000
[Install]
WantedBy=default.target
按照 systemd.unit(5) manpage 的说明,我把它放到了 ~/.config/systemd/user 目录。
然后就可以在 systemd 命令中传入 --user 来启动了:
- 立即启动:
systemctl start --user xray - 登录时启动:
systemctl enable --user xray
希望作者更新一下安装脚本,在日后以非 root 权限安装的时候能够用上这个功能。
- Dominant language
- Shell
- Stars
- 3.7k
- Forks
- 663
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 2
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from XTLS/Xray-install
-
可否支持archlinuxOpenPR welcome
Difficulty 3/5 1-2 days Newbie friendliness 35/100
XTLS/Xray-install#28 · 1 comment ·
-
可否增加openwrt的安裝?OpenPR welcome
Difficulty 4/5 3-5 days Newbie friendliness 43/100
XTLS/Xray-install#25 · 5 comments ·
All issues in XTLS/Xray-install
Similar issues
-
kind: for-triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
monumental-archive/.github#2280 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
nextlevelbuilder/dewee-desktop-app#277 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
cli/gh-extension-precompile#110 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
rstudio/r-system-requirements#273 ·
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
Maintainers usually reply within 1 day