新建/etc/systemd/system/frpc.service配置文件,并写入以下内容
[Unit]
Description=frpc
After=network.target
Wants=network.target
[Service]
User=root
Type=simple
TimeoutStartSec=30
ExecStart=/usr/local/share/frp_0.27.0_linux_amd64/frpc -c /usr/local/share/frp_0.27.0_linux_amd64/frpc.ini
Restart=on-failure
RestartSec=30
[Install]
WantedBy=multi-user.target保存退出之后,重载systemd
systemctl daemon-reload启动frpc
systemctl start frpc设置开机自启
systemctl enable frpc禁用开机自启
systemctl disable frpc停止服务
systemctl stop frpc