mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #3526] systemctl start可以启动frpc,但是reboot后,服务stopped #2816
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#2816
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 @yang369875 on GitHub (Jul 12, 2023).
Original GitHub issue: https://github.com/fatedier/frp/issues/3526
Bug Description
设置了systemctl enable,直接systemctl start是可以正常ssh,但是重启客户端后无法连接,查看status显示connect: network is unreachable
frpc service for config file [/home/pi/frp/frpc.ini] stopped
应该是说网络问题
frpc Version
0.51.0
frps Version
0.51.0
System Architecture
linux/arm
Configurations
#/usr/lib/systemd/system/frpc.service
[Unit]
Description=frps service
After=network.target syslog.target
Wants=network.target
[Service]
Type=simple
User=nobody
Restart=on-failure
RestartSec=5s
TimeoutStartSec=60
ExecStartPre=/bin/sleep 10
ExecStart=/home/pi/frp/frpc -c /home/pi/frp/frpc.ini
ExecStop=/bin/kill $MAINPID
ExecReload=/home/pi/frp/frpc reload -c /home/pi/frp/frpc.ini
[Install]
WantedBy=multi-user.target
Logs
pi@raspberrypi:~ $ sudo systemctl status frpc
● frpc.service - frp server
Loaded: loaded (/etc/systemd/system/frpc.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Wed 2023-07-12 09:54:16 CST; 18min ago
Process: 589 ExecStart=/home/pi/frp/frpc -c /home/pi/frp/frpc.ini (code=exited, status=0/SUCCESS)
Main PID: 589 (code=exited, status=0/SUCCESS)
7月 12 09:54:15 raspberrypi systemd[1]: Started frp server.
7月 12 09:54:16 raspberrypi frpc[589]: 2023/07/12 09:54:16 [I] [root.go:220] start frpc service for config file [/home/pi/frp/frpc.ini]
7月 12 09:54:16 raspberrypi frpc[589]: 2023/07/12 09:54:16 [W] [service.go:133] login to server failed: dial tcp xx.xx.xx.xx:7000: connect: network is unreachable
7月 12 09:54:16 raspberrypi frpc[589]: 2023/07/12 09:54:16 [I] [root.go:236] frpc service for config file [/home/pi/frp/frpc.ini] stopped
7月 12 09:54:16 raspberrypi systemd[1]: frpc.service: Succeeded.
ssh:
~ % ssh -oPort=6000 pi@xx.xx.xx.xx -v
OpenSSH_8.1p1, LibreSSL 2.7.3
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 47: Applying options for *
debug1: Connecting to xx.xx.xx.xx [xx.xx.xx.xx] port 6000.
debug1: connect to address xx.xx.xx.xx port 6000: Connection refused
ssh: connect to host xx.xx.xx.xx port 6000: Connection refused
Steps to reproduce
...
Affected area
@ddddavid-he commented on GitHub (Jul 12, 2023):
遇到相同问题,退回之前版本就正常,看起来是frpc在启动时联网得问题
@gexiaopeng commented on GitHub (Jul 28, 2023):
这个情况我也有时遇到,应该是frpc启动的时候,服务器网络还没有完全设置好,解决办法可以把ExecStartPre=/bin/sleep 设置的长一点 。 其实这个也是frpc的一个bug,如果能一直间隔几秒重新连接,就没有问题了。(重连的机制可以与正常连接以后的断开机制一样,间隔1秒,2秒,4秒,8秒,16秒,后面一直20秒)
@Glucy-2 commented on GitHub (Jul 31, 2023):
我也是这个情况,设置了
login_fail_exit = true也不会退出,也不会重连,就一直挂在那@gexiaopeng commented on GitHub (Aug 2, 2023):
按官方描述 login_fail_exit =true是默认设置,启动以后失败一次就退出。 可以设置login_fail_exit=false试一试,这样应该就不会退出。
@github-actions[bot] commented on GitHub (Sep 2, 2023):
Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.
@lamhui commented on GitHub (Sep 14, 2023):
请问你退回正常的版本号是多少?谢!
@ddddavid-he commented on GitHub (Sep 14, 2023):
大概是0.49和以下吧,按照上面的方法在配置文件加一行就能解决问题了
@IMJacky commented on GitHub (Oct 19, 2023):
同求,老铁们怎么解决的
@Glucy-2 commented on GitHub (Oct 19, 2023):
我设置了个5秒的启动延迟就没出现了
或者试试把依赖改成
network-online.target@IMJacky commented on GitHub (Oct 28, 2023):
After = network.target network-online.target syslog.targetWants = network.online.target在官方的实例上面添加
network.online.target这个方法亲测可行@sonor-liang commented on GitHub (Nov 20, 2023):
该方法亲测可行!!!!!!!