centos7开机自启动软件设置流程
作者:蓝眼泪
1 脚本存放位置
cd /usr/local
touch autostart.sh
cp autostart.sh /etc/rc.d/init.d/
chmod +x /etc/rc.d/init.d/autostart.sh
cd /etc/init.d/
chkconfig --add autostart.sh
chkconfig autostart.sh on
chkconfig --list
2 脚本内容
本文用prometheus软件开机自动启动作为样例。
代码如下:
#!/bin/sh
#chkconfig: 2345 80 90
#descriptiong:auto autostart
#启动prometheus