systemctl设置服务器frp服务自启动

286次阅读
没有评论

这里以启动frp客户端为例

创建服务service文件

vi /etc/systemd/system/frpc.service

内容如下:

[Unit]
Description=frp client
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
User=root
ExecStart=/usr/local/frpc/frpc -c /usr/local/frpc/frpc.toml

[Install]
WantedBy=multi-user.target

配置详解

service参数详解

启动服务

systemctl start frpc.service

停止服务

systemctl stop frpc.service

重新启动服务

systemctl restart frpc.service

设置开启自启动

systemctl enable frpc.service

配置更新

当修改了.services配置文件需要重启服务时,可以使用下面命令

systemctl daemon-reload

错误排查

使用journalctl -xe命令查看具体的日志

参考

正文完
 0
wujingquan
版权声明:本站原创文章,由 wujingquan 于2024-09-20发表,共计552字。
转载说明:Unless otherwise specified, all articles are published by cc-4.0 protocol. Please indicate the source of reprint.
评论(没有评论)