linux(Ubuntu) Frp后台自动启动的方法

背景提要

      操作系统 Ubuntu, 目的是让我的 frp 后台启动不妨碍我干其他事,同时能自启动,毕竟服务器那边常常维护重启啥的。

在这里插入图片描述

步骤

  1. 登录服务器,输入sudo vim /lib/systemd/system/frps.service 其实就是在 root/lib/systemd/system 下面新建一个文件frps.service
    在这里插入图片描述
    在这里插入图片描述

  2. 在文件里面写入以下内容

[Unit]
Description=frps daemon

[Service]
Type=simple
#此处把/root/frp_linux_arm64替换成 你的frps的实际安装目录
ExecStart=/root/frp_linux_arm64/frps -c /root/frp_linux_arm64/frps.ini

[Install]
WantedBy=multi-user.target

      你的安装目录可以这样得到,到你安装 frps 的目录下 输入pwd
在这里插入图片描述

  1. 然后就启动frps sudo systemctl start frps
  2. 再打开自启动 sudo systemctl enable frps

      搞定收工

其他

  • 重启应用 sudo systemctl restart frps
  • 停止应用 sudo systemctl stop frps
  • 查看日志 sudo systemctl status frps

参考文献

      https://github.com/fatedier/frp/issues/176

      https://gist.github.com/ihipop/4dc607caef7c874209521b10d18e35af

posted on 2021-06-06 18:41  雾恋过往  阅读(1179)  评论(0编辑  收藏  举报

Live2D