chise0713 / sing-box-install

Easiest way to install & upgrade sing-box.
https://sing-box.sagernet.org/installation/package-manager/
GNU General Public License v3.0
88 stars 18 forks source link

CentOS 7 config file not found #13

Closed Morris-Lucifer closed 8 months ago

Morris-Lucifer commented 8 months ago

[root@racknerd-446a34 ~]# bash -c "$(curl -L https://sing-box.vercel.app)" @ install % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 100 23760 100 23760 0 0 55782 0 --:--:-- --:--:-- --:--:-- 55782 @: line 489: /usr/lib/sysusers.d/sing-box.conf: No such file or directory ######################################################################## 100.0% Newest version found: sing-box-1.6.6-linux-amd64 ######################################################################## 100.0% Installed "/usr/local/bin/sing-box"

I have reinstalled 3 times, and met same problem...

chise0713 commented 8 months ago

May because your systemd version is too low that doesn't support sysuser. Use systemctl --version then put the output below. You can try useradd sing-box before you execute the script, then use .... @ --user=sing-box as argument to run the script.

Morris-Lucifer commented 8 months ago

useradd sing-box

[root@racknerd-446a34 ~]# systemctl --version systemd 219 +PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 -SECCOMP +BLKID +ELFUTILS +KMOD +IDN

After useradd sing-box, I installed successfully. Thank you!

chise0713 commented 8 months ago

Never mind, also thanks for the feedback, that can count as a bug. I'll fix it as soon as possible.

chise0713 commented 8 months ago

systemd-sysusers is introduced in systemd version 229. ( Edit: This line is incorrect. ) So your systemd version is ( Edit: may be ) too low that doesn't support sysusers, I suggest as soon as you get your vps, dd it to something like debian 12.

Morris-Lucifer commented 8 months ago

systemd-sysusers is introduced in systemd version 229. So your systemd version is too low that doesn't support sysusers, I suggest as soon as you get your vps, dd it to something like debian 12.

Got it, Thank you, Chise-Chan!

Morris-Lucifer commented 8 months ago

useradd sing-box之后我又遇到了一个问题,就是vless reality能用,但是hysteria2无论怎样都似乎没有连上,检查了端口、入站udp流量都是正常的,但是实时日志就是没有反应,所以我只能卸载了。 然后换用 https://github.com/chika0801/sing-box-examples 的第二种方式进行sing-box服务端的安装,这次非常顺利。 不知道是不是我之前的服务端配置还有别的地方要指定用户啥的。。

chise0713 commented 8 months ago

是不是没给予sing-box用户读取证书文件的权限?尝试 --user=root,一般来说安装脚本不会影响程序的运行的。

Morris-Lucifer commented 8 months ago

是不是没给予sing-box用户读取证书文件的权限?尝试 --user=root,一般来说安装脚本不会影响程序的运行的。

好像不是这个原因,这次以root用户安装,仍然是hysteria2无法连接,但是vless可以。配置文件从--user=sing-box安装以来一直保持不变 不过以root用户安装时有几个warning:

[root@racknerd-446a34 ~]#  bash -c "$(curl -L https://sing-box.vercel.app)" @ install --beta --user=root
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 23760  100 23760    0     0  37567      0 --:--:-- --:--:-- --:--:-- 37567
Installed "/etc/systemd/system/sing-box.service"
Installed "/etc/systemd/system/sing-box.service.d/"
Installed "/etc/systemd/system/sing-box.service.d/10-donot_touch.conf"
Installed "/etc/systemd/system/sing-box@.service"
Installed "/etc/systemd/system/sing-box@.service.d/"
Installed "/etc/systemd/system/sing-box@.service.d/10-donot_touch.conf"
######################################################################## 100.0%
Newest version found: sing-box-1.7.0-rc.2-linux-amd64
######################################################################## 100.0%
Installed "/usr/local/bin/sing-box"
Created symlink from /etc/systemd/system/multi-user.target.wants/sing-box.service to /etc/systemd/system/sing-box.service.
INFO: Enabled sing-box.service
INFO: Started sing-box.service.
Installed "/usr/share/bash-completion/completions/sing-box"
Installed "/usr/share/fish/vendor_completions.d/sing-box.fish"
Installed "/usr/share/zsh/site-functions/_sing-box"
WARN: Now this script is using systemd's "Drop-In file",
WARN: DO NOT override any systemd service file,
WARN: YOU MUST put your custom systemd service config in to the Drop-In file folder
WARN: "/etc/systemd/system/sing-box.service.d" and "/etc/systemd/system/sing-box@.service.d"
WARN: You can read "10-donot_touch.conf" in the folder above for more information.
chise0713 commented 8 months ago

WARN是我故意加上去的,只要安装成功就会显示。

chise0713 commented 8 months ago

保留脚本的service文件和其他文件,自行使用chika0801的readme中下载的二进制替换试试看? 或者在安装时去掉 --beta。 可以的话贴上trace的去隐私化的log

Morris-Lucifer commented 8 months ago

保留脚本的service文件和其他文件,自行使用chika0801的readme中下载的二进制替换试试看? 或者在安装时去掉 --beta。 可以的话贴上trace的去隐私化的log

去掉--beta确实恢复了,进一步的debug还不太懂只能等下次有空再看了。。。(谢谢教我修改格式

chise0713 commented 8 months ago

保留脚本的service文件和其他文件,自行使用chika0801的readme中下载的二进制替换试试看? 或者在安装时去掉 --beta。 可以的话贴上trace的去隐私化的log

去掉--beta确实恢复了,进一步的debug还不太懂只能等下次有空再看了。。。(谢谢教我修改格式

可能是这个特定的pre-release版本出现了些bug,等上游修复吧,咱没特殊需求就用release版本求稳吧~

chise0713 commented 8 months ago

Fixed: bd1e9bc135ae243d8e4601c0845b51571f910360