crontab starts frp on boot:

 ╰─➤  crontab -l                                               
@reboot cd /home/bot/opt/frp && nohup ./frpc -c ./frpc.ini > run.log 2>&1 &

But none of them were successful, let's see what's in the run.log!

 2022/08/06 21:54:13 [1;33m[W] [service.go:104] login to server failed: dial tcp 124.222.178.120:7000: connect: network is unreachable[0m
dial tcp 124.222.178.120:7000: connect: network is unreachable

You can see network is unreachable

why?

My guess is that the crontab starts frp too fast, and the Linux network module may not work properly, so frp can be started, and the network is naturally unreachable.

How to solve it?

 ╰─➤  crontab -l                                             @reboot sleep 10 && cd /home/bot/opt/frp && nohup ./frpc -c ./frpc.ini > run.log 2>&1 &

At this point, everything seems normal

 2022/09/06 21:08:25 [1;34m[I] [service.go:304] [ecf171a264223d0f] login to server success, get run id [ecf171a264223d0f], server udp port [0][0m
2022/09/06 21:08:25 [I] [proxy_manager.go:144] [ecf171a264223d0f] proxy added: [ssh][0m
2022/09/06 21:08:25 [I] [control.go:180] [ecf171a264223d0f] [ssh] start proxy success[0m

universe_king
3.4k 声望678 粉丝