当前位置: 首页 > Linux

Linux自启动脚本编写

时间:2023-04-06 21:20:29 Linux

自启动脚本,/ect/init.d/web#!/bin/bash#chkconfig:31090#描述:启动/停止webcase的脚本$1instart)systemctlstopfirewalldsystemctlstartdockervmhgfs-fuse/usr/local/web/php/www/-oallow_othervmhgfs-fuse/usr/local/web/nginx/html/-oallow_otherdockerstartopenrestydockerstartredisdockerstartmysqldockerstartphp;;stop)dockerstopopenrestydockerstopredisdockerstopmysqldockerstopphpsystemctlstopdocker;;*)echo"Usage:$0(start|stop)";;esac添加自启动配置chkconfig--addwebchkconfigwebonchkconfig--levelweb2345on//Enable2345items,016该项目已关闭。操作完成后,可以查看是否成功。chkconfig--list网络