1、准备shell脚本ApolloStartUp.sh
#!/bin/sh
#chkconfig: 2345 22 80
#description: Filebeat Service
/root/software/apollo/apollo-build-scripts-master/demo.sh start
2、将脚本移动到/etc/init.d下,并设置权限
chmod +x /etc/init.d/ApolloStartUp.sh
3、添加服务
chkconfig --add ApolloStartUp.sh