一元网络论坛

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 1110|回复: 0

frp设置开机启动失败,咋回事呢?

[复制链接]

3万

主题

3万

帖子

9万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
96169
发表于 2024-6-22 09:01:01 | 显示全部楼层 |阅读模式
frpc存放路径/frp_0.53.0_linux_arm64
直接执行/frp_0.53.0_linux_arm64/frpc -c /frp_0.53.0_linux_arm64/frpc.toml是可以正常运行的

xxx.xxx.xxx.xxx是我服务器的ip地址

然后打算做成服务来开机启动
在/etc/systemd/system创建了一个frpc.service
内容如下:
[ol]
  • [Unit]
  • Description=frpc
  • After=network.target      
  • [Service]
  • User=root
  • Type=forking
  • RemainAfterExit=yes
  • ExecStart=/frp_0.53.0_linux_arm64/frpc -c /frp_0.53.0_linux_arm64/frpc.toml
  • [Install]
  • WantedBy=multi-user.target[/ol]复制代码

    systemctl enable frpc

    然后重启系统reboot,发现frpc没有正常启动。查看日志发现
    root@raspberrypi:~# systemctl status frpc
    ● frpc.service - frpc
         Loaded: loaded (/etc/systemd/system/frpc.service; enabled; vendor preset: enabled)
         Active: failed (Result: exit-code) since Fri 2024-06-21 21:06:58 CST; 3min 46s ago
        Process: 552 ExecStart=/frp_0.53.0_linux_arm64/frpc -c /frp_0.53.0_linux_arm64/frpc.toml (code=exited, status=1/FAILURE)
            CPU: 92ms

    Jun 21 21:06:57 raspberrypi systemd[1]: Starting frpc...
    Jun 21 21:06:58 raspberrypi frpc[552]: 2024/06/21 21:06:58 [I] [root.go:141] start frpc service for config file [/frp_0.53.0_linux_arm64/frpc.toml]
    Jun 21 21:06:58 raspberrypi frpc[552]: 2024/06/21 21:06:58 [I] [service.go:288] try to connect to server...
    Jun 21 21:06:58 raspberrypi frpc[552]: 2024/06/21 21:06:58 [W] [service.go:291] connect to server error: dial tcp xxx.xxx.xxx.xxx:7000: connect: network is unreachable>
    Jun 21 21:06:58 raspberrypi frpc[552]: 2024/06/21 21:06:58 [I] [root.go:159] frpc service for config file [/frp_0.53.0_linux_arm64/frpc.toml] stopped
    Jun 21 21:06:58 raspberrypi frpc[552]: login to the server failed: dial tcp xxx.xxx.xxx.xxx:7000: connect: network is unreachable. With loginFailExit enabled, no additional retries will be attempted
    Jun 21 21:06:58 raspberrypi systemd[1]: frpc.service: Control process exited, code=exited, status=1/FAILURE
    Jun 21 21:06:58 raspberrypi systemd[1]: frpc.service: Failed with result 'exit-code'.
    Jun 21 21:06:58 raspberrypi systemd[1]: Failed to start frpc.



  • 回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    Archiver|手机版|小黑屋|一元网络论坛

    GMT+8, 2024-12-26 22:55 , Processed in 0.083202 second(s), 20 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表