mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #4350] frps无法启动 #3434
Labels
No labels
In Progress
WIP
WaitingForInfo
bug
doc
duplicate
easy
enhancement
future
help wanted
invalid
lifecycle/stale
need-issue-template
need-usage-help
no plan
proposal
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/frp#3434
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @RushCN on GitHub (Jul 25, 2024).
Original GitHub issue: https://github.com/fatedier/frp/issues/4350
Bug Description
● frps.service - frp server
Loaded: loaded (/etc/systemd/system/frps.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since 四 2024-07-25 18:27:52 CST; 9s ago
Process: 3193 ExecStart=/usr/games/frp/frps -c /usr/games/frp/frps.toml (code=exited, status=203/EXEC)
Main PID: 3193 (code=exited, status=203/EXEC)
7月 25 18:27:52 localhost.localdomain systemd[1]: Started frp server.
7月 25 18:27:52 localhost.localdomain systemd[1]: frps.service: main process exited, code=exited, status=203/EXEC
7月 25 18:27:52 localhost.localdomain systemd[1]: Unit frps.service entered failed state.
7月 25 18:27:52 localhost.localdomain systemd[1]: frps.service failed.
frpc Version
0.59.0
frps Version
0.59.0
System Architecture
linux/amd64
Configurations
Linux localhost.localdomain 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
centos-release-7-2.1511.el7.centos.2.10.x86_64
Logs
No response
Steps to reproduce
...
Affected area
@382702065 commented on GitHub (Jul 25, 2024):
应该是开启了SELinux导致的,可以查看systemd日志获取更详细的错误信息,命令为:journalctl -xe
出现以下错误则可以确认是开启了SELinux导致:
SELinux is preventing /usr/lib/systemd/systemd from execute access on the file /opt/frps/frps.
***** Plugin catchall (100. confidence) suggests **************************
If you believe that systemd should be allowed execute access on the frps file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
ausearch -c '(frps)' --raw | audit2allow -M my-frps
semodule -X 300 -i my-frps.pp
解决方法有如下两种
第一种您可以暂时关闭SELinux(本人并不推荐),以允许systemd对frps文件的执行访问。在终端中执行以下命令:
setenforce 0
第二种生成本地策略模块,您可以根据SELinux的建议生成本地策略模块,以允许systemd对frps文件的执行访问。执行以下命令:
ausearch -c '(frps)' --raw | audit2allow -M my-frps
semodule -X 300 -i my-frps.pp
此时再次启动frps脚本是否正常启动,如果不能启动则再次查看日志是否有如下错误:
***** Plugin restorecon (99.5 confidence) suggests ************************
If you want to fix the label.
/opt/frps/frps default label should be usr_t.
Then you can run restorecon. The access attempt may have been stopped due to insufficient permissions to access a pa>
Do
/sbin/restorecon -v /opt/frps/frps
如果有以上类似错误则继续执行提示的命令:
/sbin/restorecon -v /opt/frps/frps
至此我是可以正常启动。
@mvscode commented on GitHub (Jul 26, 2024):
SELinux 不是一定要开启的,你可以先手动把他关闭,然后安装frps 服务试试