Coder Social home page Coder Social logo

checkfrpc's Introduction

checkfrpc

scripts for checking frpc service on ubuntu 这个脚本就是自己写来确保每次重启frpc服务启动成功的,防止连接不到服务器

Usage

安装frpc

参考此文章

下载并修改文件

运行以下指令

  git clone https://github.com/longwayfather/checkfrpc.git
  cd checkfrpc
  vi checkfrpc.service   

修改 line 10

ExecStart=/usr/bin/python /root/checkfrpc/checkfrpc.py 

其中/usr/bin/python 修改为自己本地python安装的位置,如不知道可以使用如下命令

whereis python

用获取结果中任意一个路径替换/usr/bin/python。(python2\python3皆可)此外,还需更改/root/checkfrpc/checkfrpc.py 为下载的checkfrpc.py的绝对位置

注册为system服务

运行以下代码

 sudo cp checkfrpc.service /etc/systemd/system/
 sudo chmod +x /etc/systemd/system/checkfrpc.service # 修改权限
 sudo systemctl daemon-reload # 重载系统服务
 sudo systemctl enable checkfrpc.service # 开机自启动checkfrpc.service
 sudo systemctl start checkfrpc # 开始运行checkfrpc服务
 sudo systemctl status checkfrpc # 查看checkfrpc服务状态

此时如果出现active(running) 说明服务启动成功 之后重启,再次查看:

  sudo systemctl status checkfrpc

如果出现running(activate) 说明自启动设置成功

注意

以上基于Ubuntu20.04系统,(在centos7上测试成功)另外为了不浪费系统资源,checkfrpc服务会在25分钟后关闭,属正常现象。

checkfrpc's People

Contributors

longwayx avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.