安装systemctl

yum install systemd-sysv && reboot
apt install systemd-sysv && reboot

文字

首先创建服务( frps.service):
/lib/systemd/system/frps.service
在frps.service里写入以下内容

[Unit]
Description=fraps service
After=network.target network-online.target syslog.target
Wants=network.target network-online.target

[Service]
Type=simple

#启动服务的命令(此处写你的frps的实际安装目录)
ExecStart=[/your/path]/frps -c [/your/path]/frps.ini

[Install]
WantedBy=multi-user.target

启动
frps sudo systemctl start frps
打开自启动
sudo systemctl enable frps

相关命令

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

systemd的Unit放在目录
Centos
/usr/lib/systemd/system
Ubuntu debian
/etc/systemd/system