以Redis为例:

systemctl enable redis

就可达到Redis自启动的效果

自启动文件可以在/usr/lib/systemd/system/redis.service文件中具体执行了啥

CentOS自启动程序