一、ubuntu18.04
新建文件:/lib/systemd/system/frp.service
内容见下:
[Unit]
Description=frp
After=network.target
[Service]
Type=simple
ExecStart=/opt/iios/tools/frp/frpc -c /opt/iios/tools/frp/frpc.ini
Restart=always
RestartSec=10
StartLimitInterval=0
[Install]
WantedBy=multi-user.target
二、centos7
1、supervisor
2、systemctl
# cat /usr/lib/systemd/system/frpc.service [Unit] Description=frpc After=network.target [Service] Type=simple ExecStart=/home/tools/frp/frp_0.21.0_linux_amd64/frpc -c /home/tools/frp/frp_0.21.0_linux_amd64/frpc.ini # ExecReload=/www/lanmps/init.d/nginx restart # ExecStop=/www/lanmps/init.d/nginx stop # PrivateTmp=true [Install] WantedBy=multi-user.target