[Linux] systemd를 사용하여 frps를 제어하고 부팅 시 자동 시작을 구성합니다.

소개

Linux 시스템에서는 systemdfrp 서버 frps의 있습니다.

systemd를 제어하는 ​​데 사용하려면 먼저 설치 한 후 해당 디렉터리에 파일을 만들어야 frps합니다 .systemd/etc/systemd/systemfrps.service

설치하다systemd

Linux 서버에 설치되어 있지 않은 경우 또는 다른 명령을 사용하여 설치할 systemd수 있습니다 .yumaptsystemd

# yum
yum install systemd
# apt
apt install systemd

frps.service파일 편집

$ vim /etc/systemd/system/frps.service
콘텐츠 작성

[Unit]
# 服务名称,可自定义
Description = frp server
After = network.target syslog.target
Wants = network.target

[Service]
Type = simple
# 启动frps的命令,需修改为您的frps的安装路径
ExecStart = /path/to/frps -c /path/to/frps.ini

[Install]
WantedBy = multi-user.target

명령을 사용하여 systemdFRP 관리

# 启动frps
systemctl start frps
# 停止frps
systemctl stop frps
# 重启frps
systemctl restart frps
# 查看frps状态
systemctl status frps

frps전원을 켤 때 자동 시작 구성

systemctl enable frps

다른

systemd제어 및 구성을 사용하여 frpc부팅하는 과정은 위와 동일합니다.

おすすめ

転載: blog.csdn.net/u011308433/article/details/131591888