[GH-ISSUE #103] 无法开机启动 #51

Closed
opened 2026-05-05 11:38:17 -06:00 by gitea-mirror · 30 comments
Owner

Originally created by @liwei19920307 on GitHub (Aug 29, 2016).
Original GitHub issue: https://github.com/fatedier/frp/issues/103

添加到开机自启后 日志显示connection refused,但是直接执行却是正常的。

Originally created by @liwei19920307 on GitHub (Aug 29, 2016). Original GitHub issue: https://github.com/fatedier/frp/issues/103 添加到开机自启后 日志显示connection refused,但是直接执行却是正常的。
gitea-mirror 2026-05-05 11:38:17 -06:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@fatedier commented on GitHub (Aug 29, 2016):

不是很理解,能提供详细的系统环境和日志吗?

<!-- gh-comment-id:243111425 --> @fatedier commented on GitHub (Aug 29, 2016): 不是很理解,能提供详细的系统环境和日志吗?
Author
Owner

@liwei19920307 commented on GitHub (Aug 29, 2016):

gmial截图回复 github没显示 我就贴部分错误了 xxxxxx 均为打码

你好 我服务器是centos frps配置如下

[common]
bind_addr = 0.0.0.0
bind_port = xxxxxxx
vhost_http_port = 80
vhost_https_port = 443
dashboard_port = xxxxxx
#log_file = /root/frps/frps.log
log_level = info
log_max_days = 3
privilege_mode = true
privilege_token = xxxx
#privilege_allow_ports = 2000-3000,3001,3003,4000-50000
#max_pool_count = 100

​frpc部分配置
[common]
server_addr =xxxxxx
server_port = 66
#log_file = /home/pi/Kevin/frpc/frpc.log
#log_level = info
#log_max_days = 3
auth_token = xxxxxx
privilege_token = xxxxxxx
#use_encryption = true
#use_gzip = true

[xxxxx]
privilege_mode = true
custom_domains = xxxxxx
type = http
local_ip = 127.0.0.1
local_port = 80
.....

​我在/etc/init.d/添加了这个服务rc.loacl我也试过了

#!/bin/sh

### BEGIN INIT INFO
# Provides:          frpc
# Required-Start:    $local_fs $remote_fs $network $syslog
# Required-Stop:     $local_fs $remote_fs $network $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: start frpc
# Description:       start frpc
### END INIT INFO

case $1 in
        start)
                /home/pi/Kevin/frpc/frpc -c /home/pi/Kevin/frpc/frpc.ini > /home/pi/log
                ;;
        stop)
                killall frpc
                ;;
        restart)
                $0 stop
                sleep 2
                $0 start
                ;;
*)
echo "Usage: $0 (start|stop|restart)"
;;

esac

exit 0

​自启动后日志如下

2016/08/29 19:50:33 [main.go:109] [I] Start frpc success
2016/08/29 19:50:33 [control.go:135] [E] ProxyName [kevin], connect to server [lxxxxxx] error, lookup liwei.gq on [::1]:53: read udp [::1]:33730->[::1]:53: read: connection refused
2016/08/29 19:50:33 [control.go:39] [E] ProxyName [kevin], connect to server failed!
2016/08/29 19:50:33 [control.go:135] [E] ProxyName [kssh], connect to server [lxxxxxxx] error, lookup liwei.gq on [::1]:53: read udp [::1]:33730->[::1]:53: read: connection refused
2016/08/29 19:50:33 [control.go:39] [E] ProxyName [kssh], connect to server failed!
2016/08/29 19:50:33 [control.go:135] [E] ProxyName [wiki], connect to server [xxxxxxx] error, lookup liwei.gq on [::1]:53: read udp [::1]:33730->[::1]:53: read: connection refused
2016/08/29 19:50:33 [control.go:39] [E] ProxyName [wiki], connect to server failed!
2016/08/29 19:50:33 [control.go:135] [E] ProxyName [rpc], connect to server [xxxx] error, lookup liwei.gq on [::1]:53: read udp [::1]:33730->[::1]:53: read: connection refused
2016/08/29 19:50:33 [control.go:39] [E] ProxyName [rpc], connect to server failed!
2016/08/29 19:50:33 [control.go:135] [E] ProxyName [ssh], connect to server [xxxxx] error, lookup liwei.gq on [::1]:53: read udp [::1]:33730->[::1]:53: read: connection refused
省略类似的。。。
2016/08/29 19:50:33 [control.go:39] [E] ProxyName [demo], connect to server failed!
2016/08/29 19:50:33 [main.go:112] [W] All proxy exit!

但是正常手动运行是正常的没有任何问题
/home/pi/Kevin/frpc/frpc -c /home/pi/Kevin/frpc/frpc.ini 没有任何问题

2016-08-29 20:35 GMT+08:00 fatedier notifications@github.com:

不是很理解,能提供详细的系统环境和日志吗?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/fatedier/frp/issues/103#issuecomment-243111425, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AK88wa7iWZSz0LCw73pyfdNv-VWbH5tKks5qktIYgaJpZM4Jvamc
.

<!-- gh-comment-id:243120227 --> @liwei19920307 commented on GitHub (Aug 29, 2016): gmial截图回复 github没显示 我就贴部分错误了 xxxxxx 均为打码 你好 我服务器是centos frps配置如下 ``` [common] bind_addr = 0.0.0.0 bind_port = xxxxxxx vhost_http_port = 80 vhost_https_port = 443 dashboard_port = xxxxxx #log_file = /root/frps/frps.log log_level = info log_max_days = 3 privilege_mode = true privilege_token = xxxx #privilege_allow_ports = 2000-3000,3001,3003,4000-50000 #max_pool_count = 100 ``` ​frpc部分配置 [common] server_addr =xxxxxx server_port = 66 #log_file = /home/pi/Kevin/frpc/frpc.log #log_level = info #log_max_days = 3 auth_token = xxxxxx privilege_token = xxxxxxx #use_encryption = true #use_gzip = true [xxxxx] privilege_mode = true custom_domains = xxxxxx type = http local_ip = 127.0.0.1 local_port = 80 ..... ​我在/etc/init.d/添加了这个服务rc.loacl我也试过了 ``` #!/bin/sh ### BEGIN INIT INFO # Provides: frpc # Required-Start: $local_fs $remote_fs $network $syslog # Required-Stop: $local_fs $remote_fs $network $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: start frpc # Description: start frpc ### END INIT INFO case $1 in start) /home/pi/Kevin/frpc/frpc -c /home/pi/Kevin/frpc/frpc.ini > /home/pi/log ;; stop) killall frpc ;; restart) $0 stop sleep 2 $0 start ;; *) echo "Usage: $0 (start|stop|restart)" ;; esac exit 0 ``` ​自启动后日志如下 ``` 2016/08/29 19:50:33 [main.go:109] [I] Start frpc success 2016/08/29 19:50:33 [control.go:135] [E] ProxyName [kevin], connect to server [lxxxxxx] error, lookup liwei.gq on [::1]:53: read udp [::1]:33730->[::1]:53: read: connection refused 2016/08/29 19:50:33 [control.go:39] [E] ProxyName [kevin], connect to server failed! 2016/08/29 19:50:33 [control.go:135] [E] ProxyName [kssh], connect to server [lxxxxxxx] error, lookup liwei.gq on [::1]:53: read udp [::1]:33730->[::1]:53: read: connection refused 2016/08/29 19:50:33 [control.go:39] [E] ProxyName [kssh], connect to server failed! 2016/08/29 19:50:33 [control.go:135] [E] ProxyName [wiki], connect to server [xxxxxxx] error, lookup liwei.gq on [::1]:53: read udp [::1]:33730->[::1]:53: read: connection refused 2016/08/29 19:50:33 [control.go:39] [E] ProxyName [wiki], connect to server failed! 2016/08/29 19:50:33 [control.go:135] [E] ProxyName [rpc], connect to server [xxxx] error, lookup liwei.gq on [::1]:53: read udp [::1]:33730->[::1]:53: read: connection refused 2016/08/29 19:50:33 [control.go:39] [E] ProxyName [rpc], connect to server failed! 2016/08/29 19:50:33 [control.go:135] [E] ProxyName [ssh], connect to server [xxxxx] error, lookup liwei.gq on [::1]:53: read udp [::1]:33730->[::1]:53: read: connection refused 省略类似的。。。 2016/08/29 19:50:33 [control.go:39] [E] ProxyName [demo], connect to server failed! 2016/08/29 19:50:33 [main.go:112] [W] All proxy exit! ``` ​ 但是正常手动运行是正常的没有任何问题 `/home/pi/Kevin/frpc/frpc -c /home/pi/Kevin/frpc/frpc.ini 没有任何问题` ​ 2016-08-29 20:35 GMT+08:00 fatedier notifications@github.com: > 不是很理解,能提供详细的系统环境和日志吗? > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > https://github.com/fatedier/frp/issues/103#issuecomment-243111425, or mute > the thread > https://github.com/notifications/unsubscribe-auth/AK88wa7iWZSz0LCw73pyfdNv-VWbH5tKks5qktIYgaJpZM4Jvamc > .
Author
Owner

@liwei19920307 commented on GitHub (Aug 29, 2016):

忘记说了 我的客户端是debian树莓派跑的 我在单位的ubuntu上也试了不行 不知道是我那写错了吗

2016-08-29 20:35 GMT+08:00 fatedier notifications@github.com:

不是很理解,能提供详细的系统环境和日志吗?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/fatedier/frp/issues/103#issuecomment-243111425, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AK88wa7iWZSz0LCw73pyfdNv-VWbH5tKks5qktIYgaJpZM4Jvamc
.

<!-- gh-comment-id:243129220 --> @liwei19920307 commented on GitHub (Aug 29, 2016): 忘记说了 我的客户端是debian树莓派跑的 我在单位的ubuntu上也试了不行 不知道是我那写错了吗 2016-08-29 20:35 GMT+08:00 fatedier notifications@github.com: > 不是很理解,能提供详细的系统环境和日志吗? > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > https://github.com/fatedier/frp/issues/103#issuecomment-243111425, or mute > the thread > https://github.com/notifications/unsubscribe-auth/AK88wa7iWZSz0LCw73pyfdNv-VWbH5tKks5qktIYgaJpZM4Jvamc > .
Author
Owner

@fatedier commented on GitHub (Aug 29, 2016):

看起来是 dns 解析的问题,你可以换成 ip 试试。另外你的 /etc/resolv.conf 里是怎么配的?

<!-- gh-comment-id:243142248 --> @fatedier commented on GitHub (Aug 29, 2016): 看起来是 dns 解析的问题,你可以换成 ip 试试。另外你的 `/etc/resolv.conf` 里是怎么配的?
Author
Owner

@liwei19920307 commented on GitHub (Aug 29, 2016):

pi@liwei:~/Kevin/frpc $ cat /etc/resolv.conf

Generated by resolvconf

domain lan
nameserver 192.168.2.1

DNS我没动 不支持域名吗 那为什么手动启动可以 我试了IP 还是相同的错误

2016-08-29 22:34 GMT+08:00 fatedier notifications@github.com:

看起来是 dns 解析的问题,你可以换成 ip 试试。另外你的 /etc/resolv.conf 里是怎么配的?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/fatedier/frp/issues/103#issuecomment-243142248, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AK88wTYhpluTWtBjHn53QD9VqCoj2sIZks5qku3sgaJpZM4Jvamc
.

<!-- gh-comment-id:243144385 --> @liwei19920307 commented on GitHub (Aug 29, 2016): pi@liwei:~/Kevin/frpc $ cat /etc/resolv.conf # Generated by resolvconf domain lan nameserver 192.168.2.1 DNS我没动 不支持域名吗 那为什么手动启动可以 我试了IP 还是相同的错误 2016-08-29 22:34 GMT+08:00 fatedier notifications@github.com: > 看起来是 dns 解析的问题,你可以换成 ip 试试。另外你的 /etc/resolv.conf 里是怎么配的? > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > https://github.com/fatedier/frp/issues/103#issuecomment-243142248, or mute > the thread > https://github.com/notifications/unsubscribe-auth/AK88wTYhpluTWtBjHn53QD9VqCoj2sIZks5qku3sgaJpZM4Jvamc > .
Author
Owner

@fatedier commented on GitHub (Aug 29, 2016):

lookup liwei.gq on [::1]:53: read udp [::1]:33730->[::1]:53: read: connection refused

这里服务器的 liwei.gq 换成 ip 还是相同的错误?具体是什么原因我也不是很清楚,但是看起来就是 frpc 要连接 frps,然后你 server 地址填的是 liwei.gq,而解析这个域名时查询的是本地的 ipv6 的 53 端口,结果这个端口并没有启用,所以返回了 connection refused

<!-- gh-comment-id:243147342 --> @fatedier commented on GitHub (Aug 29, 2016): `lookup liwei.gq on [::1]:53: read udp [::1]:33730->[::1]:53: read: connection refused` 这里服务器的 `liwei.gq` 换成 ip 还是相同的错误?具体是什么原因我也不是很清楚,但是看起来就是 frpc 要连接 frps,然后你 server 地址填的是 `liwei.gq`,而解析这个域名时查询的是本地的 ipv6 的 53 端口,结果这个端口并没有启用,所以返回了 `connection refused`。
Author
Owner

@liwei19920307 commented on GitHub (Aug 29, 2016):

对 换成frpc换成对应IP还是相同错误 但是手动启动依然可以 那我试着关闭ipv6试试看 谢谢

2016-08-29 22:51 GMT+08:00 fatedier notifications@github.com:

lookup liwei.gq on [::1]:53: read udp [::1]:33730->[::1]:53: read:
connection refused

这里服务器的 liwei.gq 换成 ip 还是相同的错误?具体是什么原因我也不是很清楚,但是看起来就是 frpc 要连接 frps,然后你
server 地址填的是 liwei.gq,而解析这个域名时查询的是本地的 ipv6 的 53 端口,结果这个端口并没有启用,所以返回了 connection
refused。


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/fatedier/frp/issues/103#issuecomment-243147342, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AK88wbnUNRZ9FryaUsH4qh9armR-zijJks5qkvHpgaJpZM4Jvamc
.

<!-- gh-comment-id:243148229 --> @liwei19920307 commented on GitHub (Aug 29, 2016): 对 换成frpc换成对应IP还是相同错误 但是手动启动依然可以 那我试着关闭ipv6试试看 谢谢 2016-08-29 22:51 GMT+08:00 fatedier notifications@github.com: > lookup liwei.gq on [::1]:53: read udp [::1]:33730->[::1]:53: read: > connection refused > > 这里服务器的 liwei.gq 换成 ip 还是相同的错误?具体是什么原因我也不是很清楚,但是看起来就是 frpc 要连接 frps,然后你 > server 地址填的是 liwei.gq,而解析这个域名时查询的是本地的 ipv6 的 53 端口,结果这个端口并没有启用,所以返回了 connection > refused。 > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > https://github.com/fatedier/frp/issues/103#issuecomment-243147342, or mute > the thread > https://github.com/notifications/unsubscribe-auth/AK88wbnUNRZ9FryaUsH4qh9armR-zijJks5qkvHpgaJpZM4Jvamc > .
Author
Owner

@liwei19920307 commented on GitHub (Aug 29, 2016):

我刚才看了下 我VPS并没有启动IPV6 我明天试下centos自启frpc

在 2016年8月29日 下午10:53,Kevin Li liwei19920307@gmail.com写道:

对 换成frpc换成对应IP还是相同错误 但是手动启动依然可以 那我试着关闭ipv6试试看 谢谢

2016-08-29 22:51 GMT+08:00 fatedier notifications@github.com:

lookup liwei.gq on [::1]:53: read udp [::1]:33730->[::1]:53: read:
connection refused

这里服务器的 liwei.gq 换成 ip 还是相同的错误?具体是什么原因我也不是很清楚,但是看起来就是 frpc 要连接 frps,然后你
server 地址填的是 liwei.gq,而解析这个域名时查询的是本地的 ipv6 的 53 端口,结果这个端口并没有启用,所以返回了 connection
refused。


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/fatedier/frp/issues/103#issuecomment-243147342, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AK88wbnUNRZ9FryaUsH4qh9armR-zijJks5qkvHpgaJpZM4Jvamc
.

<!-- gh-comment-id:243149004 --> @liwei19920307 commented on GitHub (Aug 29, 2016): 我刚才看了下 我VPS并没有启动IPV6 我明天试下centos自启frpc 在 2016年8月29日 下午10:53,Kevin Li liwei19920307@gmail.com写道: > 对 换成frpc换成对应IP还是相同错误 但是手动启动依然可以 那我试着关闭ipv6试试看 谢谢 > > 2016-08-29 22:51 GMT+08:00 fatedier notifications@github.com: > > > lookup liwei.gq on [::1]:53: read udp [::1]:33730->[::1]:53: read: > > connection refused > > > > 这里服务器的 liwei.gq 换成 ip 还是相同的错误?具体是什么原因我也不是很清楚,但是看起来就是 frpc 要连接 frps,然后你 > > server 地址填的是 liwei.gq,而解析这个域名时查询的是本地的 ipv6 的 53 端口,结果这个端口并没有启用,所以返回了 connection > > refused。 > > > > — > > You are receiving this because you authored the thread. > > Reply to this email directly, view it on GitHub > > https://github.com/fatedier/frp/issues/103#issuecomment-243147342, or mute > > the thread > > https://github.com/notifications/unsubscribe-auth/AK88wbnUNRZ9FryaUsH4qh9armR-zijJks5qkvHpgaJpZM4Jvamc > > .
Author
Owner

@fatedier commented on GitHub (Aug 29, 2016):

我不是很理解为什么换成 ip 了之后还会遇到查询 dns 的错误,可能还有一些隐藏的其他问题。

<!-- gh-comment-id:243149457 --> @fatedier commented on GitHub (Aug 29, 2016): 我不是很理解为什么换成 ip 了之后还会遇到查询 dns 的错误,可能还有一些隐藏的其他问题。
Author
Owner

@Coande commented on GitHub (Sep 11, 2016):

同是树莓派,无论编辑rc.local还是添加到init.d,都无法启动frpc。手动启动没有问题。

<!-- gh-comment-id:246169292 --> @Coande commented on GitHub (Sep 11, 2016): 同是树莓派,无论编辑rc.local还是添加到init.d,都无法启动frpc。手动启动没有问题。
Author
Owner

@liwei19920307 commented on GitHub (Sep 11, 2016):

Debian下应该都有这个问题,目前我是延迟启动解决的就是sleep 60秒 然后启动frpc就没问题,至少10秒

<!-- gh-comment-id:246169942 --> @liwei19920307 commented on GitHub (Sep 11, 2016): Debian下应该都有这个问题,目前我是延迟启动解决的就是sleep 60秒 然后启动frpc就没问题,至少10秒
Author
Owner

@Coande commented on GitHub (Sep 11, 2016):

果然,sleep 10秒就可以了。THS

<!-- gh-comment-id:246170612 --> @Coande commented on GitHub (Sep 11, 2016): 果然,sleep 10秒就可以了。THS
Author
Owner

@ghsa1994 commented on GitHub (Oct 25, 2016):

楼主你的树莓派可以开机自启动了吗?我的同样是树莓派平台客户端无法开机自启动,试过各种办法,服务端在搬瓦工的Centos 6 x86可以重启自启动

<!-- gh-comment-id:256087438 --> @ghsa1994 commented on GitHub (Oct 25, 2016): 楼主你的树莓派可以开机自启动了吗?我的同样是树莓派平台客户端无法开机自启动,试过各种办法,服务端在搬瓦工的Centos 6 x86可以重启自启动
Author
Owner

@liwei19920307 commented on GitHub (Oct 26, 2016):

在你的启动脚本之前填上sleep 10 例如:
sleep 10
.../frps -c ../frpc.ini

<!-- gh-comment-id:256221851 --> @liwei19920307 commented on GitHub (Oct 26, 2016): 在你的启动脚本之前填上sleep 10 例如: sleep 10 .../frps -c ../frpc.ini
Author
Owner

@ghsa1994 commented on GitHub (Oct 27, 2016):

谢谢,现在已经可以正常开机运行了,frp速度很快,比花生壳好多了

<!-- gh-comment-id:256528633 --> @ghsa1994 commented on GitHub (Oct 27, 2016): 谢谢,现在已经可以正常开机运行了,frp速度很快,比花生壳好多了
Author
Owner

@orangeshu commented on GitHub (Nov 12, 2016):

我是个新手。想请问为啥要延迟10秒啊?对于ubuntu系统也可以吗?

<!-- gh-comment-id:260098475 --> @orangeshu commented on GitHub (Nov 12, 2016): 我是个新手。想请问为啥要延迟10秒啊?对于ubuntu系统也可以吗?
Author
Owner

@ghsa1994 commented on GitHub (Nov 12, 2016):

自己试验一下 估计是等待加载什么服务之后再启动frp客户端才有效 Linux各平台都不一样 自己试验一下

<!-- gh-comment-id:260098592 --> @ghsa1994 commented on GitHub (Nov 12, 2016): 自己试验一下 估计是等待加载什么服务之后再启动frp客户端才有效 Linux各平台都不一样 自己试验一下
Author
Owner

@orangeshu commented on GitHub (Nov 12, 2016):

好的,谢谢!

<!-- gh-comment-id:260098651 --> @orangeshu commented on GitHub (Nov 12, 2016): 好的,谢谢!
Author
Owner

@cercky commented on GitHub (Jan 16, 2017):

我将# Default-Start: 2 3 4 5 修改成了# Default-Start: 3 4 5 去掉无网络环境启动 可以正常工作,前提是fprs可正常链接。

据我观察是fprc不支持无连接启动 和无网络启动, 如果可以的话请增加在这2种模式下fprc不退出的机制。

<!-- gh-comment-id:272765485 --> @cercky commented on GitHub (Jan 16, 2017): 我将# Default-Start: 2 3 4 5 修改成了# Default-Start: 3 4 5 去掉无网络环境启动 可以正常工作,前提是fprs可正常链接。 据我观察是fprc不支持无连接启动 和无网络启动, 如果可以的话请增加在这2种模式下fprc不退出的机制。
Author
Owner

@fatedier commented on GitHub (Jun 1, 2017):

0.11.0 版本 frpc 新增了 log_fail_exit 配置项,如果为 false,则启动失败不会退出。

<!-- gh-comment-id:305541663 --> @fatedier commented on GitHub (Jun 1, 2017): 0.11.0 版本 frpc 新增了 `log_fail_exit` 配置项,如果为 false,则启动失败不会退出。
Author
Owner

@yanfeng42 commented on GitHub (Nov 14, 2017):

@fatedier 只发现了 login_fail_exit = true, 把这个改为 false 可以解决问题.即:
在frpc.ini [common]配置下,添加
login_fail_exit = false 验证可以解决树莓派无法重启自动启动 frpc 的问题

<!-- gh-comment-id:344119488 --> @yanfeng42 commented on GitHub (Nov 14, 2017): @fatedier 只发现了 login_fail_exit = true, 把这个改为 false 可以解决问题.即: 在frpc.ini [common]配置下,添加 `login_fail_exit = false` 验证可以解决树莓派无法重启自动启动 frpc 的问题
Author
Owner

@astbl123 commented on GitHub (Dec 18, 2017):

@ios122 如果ubuntu加了这句“login_fail_exit = false”会导致系统无法启动,因为网络没准备好,系统一直卡在frp那里。

<!-- gh-comment-id:352330557 --> @astbl123 commented on GitHub (Dec 18, 2017): @ios122 如果ubuntu加了这句“login_fail_exit = false”会导致系统无法启动,因为网络没准备好,系统一直卡在frp那里。
Author
Owner

@yanfeng42 commented on GitHub (Dec 18, 2017):

@astbl123 我的并没有卡在这里;我看这里的日志,类似于一个失败后,自动重试的策略;日志中,有多次尝试连接的记录; 估计和其他配置项 也有关系;

<!-- gh-comment-id:352352446 --> @yanfeng42 commented on GitHub (Dec 18, 2017): @astbl123 我的并没有卡在这里;我看这里的日志,类似于一个失败后,自动重试的策略;日志中,有多次尝试连接的记录; 估计和其他配置项 也有关系;
Author
Owner

@liwei19920307 commented on GitHub (Dec 18, 2017):

个人知道的frp正常运行需要两个条件:1.能联网2.服务器时间和客户端时间正确
1.网络可以通过After=network.target

[Unit]
Description=frpc
After=network.target ntpdate.service

[Service]
Type=simple
User=root
PIDFile=/var/run/frpc.pid
ExecStart=/home/oi/Kevin/frp/frpc -c /home/oi/Kevin/frp/frpc.ini
Restart=on-failure
RestartSec=15s

[Install]
WantedBy=multi-user.target

2.时间可以After=ntpdate.service,ntpdate.service是我自己写的一个开机服务用来开机时对时,系统需要安装ntpdate,这样log_fail_exit配置项都不需要加

[Unit]
Description=ntpdate
After=network.target

[Service]
Type=simple
User=root
PIDFile=/var/run/ntpdate.pid
ExecStart=/usr/sbin/ntpdate time.windows.com
Restart=on-failure
RestartSec=15s

[Install]
WantedBy=multi-user.target

<!-- gh-comment-id:352355115 --> @liwei19920307 commented on GitHub (Dec 18, 2017): 个人知道的frp正常运行需要两个条件:1.能联网2.服务器时间和客户端时间正确 1.网络可以通过After=network.target ``` [Unit] Description=frpc After=network.target ntpdate.service [Service] Type=simple User=root PIDFile=/var/run/frpc.pid ExecStart=/home/oi/Kevin/frp/frpc -c /home/oi/Kevin/frp/frpc.ini Restart=on-failure RestartSec=15s [Install] WantedBy=multi-user.target ``` 2.时间可以After=ntpdate.service,ntpdate.service是我自己写的一个开机服务用来开机时对时,系统需要安装ntpdate,这样`log_fail_exit`配置项都不需要加 ``` [Unit] Description=ntpdate After=network.target [Service] Type=simple User=root PIDFile=/var/run/ntpdate.pid ExecStart=/usr/sbin/ntpdate time.windows.com Restart=on-failure RestartSec=15s [Install] WantedBy=multi-user.target ```
Author
Owner

@astbl123 commented on GitHub (Dec 18, 2017):

@liwei19920307 请问你的是脚本还是什么?看不懂这些配置。

<!-- gh-comment-id:352358934 --> @astbl123 commented on GitHub (Dec 18, 2017): @liwei19920307 请问你的是脚本还是什么?看不懂这些配置。
Author
Owner

@astbl123 commented on GitHub (Dec 18, 2017):

@ios122 如果不加“login_fail_exit = false”,就会尝试一次后退出,日志如下:
2017/12/18 16:37:12 [W] [control.go:121] login to server failed: dial tcp x.x.x.x:7000: connect: network is unreachable
dial tcp x.x.x.x:7000: connect: network is unreachable

<!-- gh-comment-id:352360606 --> @astbl123 commented on GitHub (Dec 18, 2017): @ios122 如果不加“login_fail_exit = false”,就会尝试一次后退出,日志如下: 2017/12/18 16:37:12 [W] [control.go:121] login to server failed: dial tcp x.x.x.x:7000: connect: network is unreachable dial tcp x.x.x.x:7000: connect: network is unreachable
Author
Owner

@liwei19920307 commented on GitHub (Dec 18, 2017):

@astbl123 systemd的脚本

<!-- gh-comment-id:352361204 --> @liwei19920307 commented on GitHub (Dec 18, 2017): @astbl123 systemd的脚本
Author
Owner

@PHCSJC commented on GitHub (Dec 25, 2018):

@ios122 如果ubuntu加了这句“login_fail_exit = false”会导致系统无法启动,因为网络没准备好,系统一直卡在frp那里。

放到后台就不会卡系统了
nohup frpc -c frpc.ini &

<!-- gh-comment-id:449852434 --> @PHCSJC commented on GitHub (Dec 25, 2018): > @ios122 如果ubuntu加了这句“login_fail_exit = false”会导致系统无法启动,因为网络没准备好,系统一直卡在frp那里。 放到后台就不会卡系统了 `nohup frpc -c frpc.ini &`
Author
Owner

@keyne-wang commented on GitHub (Jun 9, 2021):

@ios122 如果ubuntu加了这句“login_fail_exit = false”会导致系统无法启动,因为网络没准备好,系统一直卡在frp那里。

放到后台就不会卡系统了
nohup frpc -c frpc.ini &

这个放到哪里啊?

<!-- gh-comment-id:857733805 --> @keyne-wang commented on GitHub (Jun 9, 2021): > > @ios122 如果ubuntu加了这句“login_fail_exit = false”会导致系统无法启动,因为网络没准备好,系统一直卡在frp那里。 > > 放到后台就不会卡系统了 > `nohup frpc -c frpc.ini &` 这个放到哪里啊?
Author
Owner

@kouk1014 commented on GitHub (May 9, 2022):

如果是用的chkconfig做的启动脚本,要看下启动顺序,就脚本第二行 #chkconfig: 2345 80 90 ,第二个数字,network的优先权是10,如果这个脚本的优先权也是10 就会出现网络还没启动好链接失败的问题, 改成大点的数例如80就好了

<!-- gh-comment-id:1120596860 --> @kouk1014 commented on GitHub (May 9, 2022): 如果是用的chkconfig做的启动脚本,要看下启动顺序,就脚本第二行 #chkconfig: 2345 80 90 ,第二个数字,network的优先权是10,如果这个脚本的优先权也是10 就会出现网络还没启动好链接失败的问题, 改成大点的数例如80就好了
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#51
No description provided.