Fork me on GitHub

CentOS 7.9 FastDFS 设置开机自启动

CentOS 7.9 FastDFS 设置开机自启动


 

一、前言

关于 FastDFS 服务的启动、停止、重启 相关脚本,可以参考如下博客:

https://www.cnblogs.com/miracle-luna/p/17750542.html

本文主要讲解如何使用 systemctl 系统命令,进行启动、停止、重启、查看 FastDFS 状态等操作。

 

 

二、实现步骤

1、编写 Nacos 系统启动文件

/lib/systemd/system 目录下创建 fastdfs.service 文件

vi /lib/systemd/system/fastdfs.service

 

编写内容如下:

[Unit]
Description=fastdfs - Fast Distributed File System
After=network.target
 
[Service]
Type=forking
ExecStart=/home/startFastDFS.sh
ExecReload=/home/stopFastDFS.sh
ExecStop=/home/stopFastDFS.sh
PrivateTmp=true
 
[Install]
WantedBy=multi-user.target

说明:其中的 /home/ 目录改为实际的脚本存放目录。

 

2、重载所有服务

systemctl daemon-reload

 

3、设置开机自启动

systemctl enable fastdfs

 

4、查看开机启动状态

systemctl is-enabled fastdfs

 

5、查看 FastDFS 服务状态

systemctl status fastdfs

 

6、启动 FastDFS 服务

systemctl start fastdfs

 

7、停止 FastDFS 服务

systemctl stop fastdfs

 

8、重启 FastDFS 服务

systemctl restart fastdfs

 

 

PS:

关于 CentOS 7.9 FastDFS 的安装、部署、调试过程,可以参考如下博客:

https://www.cnblogs.com/miracle-luna/p/17552960.html

 

 

posted @ 2023-10-09 10:11  龙凌云端  阅读(327)  评论(0编辑  收藏  举报