自启脚本,/ect/init.d/web

#!/bin/bash
# chkconfig: 3 10 90
# description: script to start/stop web
case $1 in
start)
systemctl stop firewalld
systemctl start docker
vmhgfs-fuse /usr/local/web/php/www/ -o allow_other
vmhgfs-fuse /usr/local/web/nginx/html/ -o allow_other
docker start openresty
docker start redis
docker start mysql
docker start php
;;
stop)
docker stop openresty
docker stop redis
docker stop mysql
docker stop php
systemctl stop docker
;;
*)
echo "Usage: $0 (start|stop)"
;;
esac

添加自启配置

chkconfig --add web
chkconfig web on
chkconfig --level web2345 on //开启2 3 4 5项,0 1 6项为关闭状态
操作完成后可以查看是否成功
chkconfig --list web

吃饭饭睡觉觉
62 声望4 粉丝