FRP set up auto start service

Time:2021-2-26

Server

$ sudo vi /lib/systemd/system/frps.service
--------------------------------

$ cat frps.service
[Unit]
Description=Frp Server Service
After=network.target

[Service]
Type=simple
User=nobody
Restart=on-failure
RestartSec=5s
ExecStart=/usr/bin/frps -c /etc/frp/frps.ini

[Install]
WantedBy=multi-user.target
--------------------------------

$ sudo systemctl daemon-reload
$ sudo systemctl enable frps
--------------------------------

client

$ sudo vi /lib/systemd/system/frpc.service
--------------------------------

$ cat frpc.service 
[Unit]
Description=Frp Client Service
After=network.target

[Service]
Type=simple
User=root
Restart=on-failure
RestartSec=5s
ExecStart=/usr/bin/frpc -c /etc/frp/frpc.ini
ExecReload=/usr/bin/frpc reload -c /etc/frp/frpc.ini

[Install]
WantedBy=multi-user.target
--------------------------------

$ sudo systemctl daemon-reload
$ sudo systemctl enable frpc
--------------------------------

Recommended Today

Rust and python: why rust can replace Python

In this guide, we compare the rust and python programming languages. We will discuss the applicable use cases in each case, review the advantages and disadvantages of using rust and python, and explain why rust might replace python. I will introduce the following: What is rust? What is Python? When to use rust When to […]