記錄一下Linux設置Frp開機啟動的方法
- 在/etc/systemd/system下添加frps.service或frpc.service
[Unit]
Description=frpc daemon
After=syslog.target network.target
Wants=network.target
[Service]
Type=simple
ExecStart=/root/frpc/frpc -c /root/frpc/frpc.ini #啟動命令根據自己情況填寫目錄
Restart= always
RestartSec=1min
ExecStop=/usr/bin/killall frpc
[Install]
WantedBy=multi-user.target
- 相關命令
systemctl enable frpc(frps) #設置開機啟動
systemctl start frpc(frps) #啟動
systemctl stop frpc(frps) #停止
systemctl status frpc(frps) #狀態