喜欢就分享给更多人!

服务器需要扩容,如何停止宝塔的所有服务?

建站教程 09-21 19:12
服务器需要扩容,如何停止宝塔的所有服务?

内容

教程开始

1:新建一个shell脚本执行以下代码
或者进面板 把以下代码丢到计划任务里的shell脚本执行

#!/bin/bash PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin export PATH stop_service(){         /etc/init.d/bt stop         if [ -f "/etc/init.d/nginx" ]; then                 /etc/init.d/nginx stop > /dev/null 2>&1         fi         if [ -f "/etc/init.d/httpd" ]; then                 /etc/init.d/httpd stop > /dev/null 2>&1         fi         if [ -f "/etc/init.d/mysqld" ]; then                 /etc/init.d/mysqld stop > /dev/null 2>&1         fi         if [ -f "/etc/init.d/pure-ftpd" ]; then                 /etc/init.d/pure-ftpd stop > /dev/null 2>&1         fi         if [ -f "/etc/init.d/tomcat" ]; then                 /etc/init.d/tomcat stop > /dev/null 2>&1         fi         if [ -f "/etc/init.d/redis" ]; then                 /etc/init.d/redis stop > /dev/null 2>&1         fi         if [ -f "/etc/init.d/memcached" ]; then                 /etc/init.d/memcached stop > /dev/null 2>&1         fi         if [ -f "/www/server/panel/data/502Task.pl" ]; then                 rm -f /www/server/panel/data/502Task.pl                 if [ -f "/etc/init.d/php-fpm-52" ]; then                         /etc/init.d/php-fpm-52 stop > /dev/null 2>&1                 fi                 if [ -f "/etc/init.d/php-fpm-53" ]; then                         /etc/init.d/php-fpm-53 stop > /dev/null 2>&1                 fi                 if [ -f "/etc/init.d/php-fpm-54" ]; then                         /etc/init.d/php-fpm-54 stop > /dev/null 2>&1                 fi                 if [ -f "/etc/init.d/php-fpm-55" ]; then                         /etc/init.d/php-fpm-55 stop > /dev/null 2>&1                 fi                 if [ -f "/etc/init.d/php-fpm-56" ]; then                         /etc/init.d/php-fpm-56 stop > /dev/null 2>&1                 fi                 if [ -f "/etc/init.d/php-fpm-70" ]; then                         /etc/init.d/php-fpm-70 stop > /dev/null 2>&1                 fi                 if [ -f "/etc/init.d/php-fpm-71" ]; then                         /etc/init.d/php-fpm-71 stop > /dev/null 2>&1                 fi         fi         swapoff /www/swap } stop_service

2:执行完后扩容好磁盘后重新挂载上去后执行以下两条命令

swapon /www/swap echo "True" > /www/server/panel/data/502Task.pl

3:最后别忘了启动宝塔服务

/etc/init.d/bt start

友情链接: 菜鸟吧源码 菜鸟聚会登录 网站目录大全 菜鸟吧导航网 冒泡网赚 中创网 福缘创业网 臭虾米项目网 小淘学社 吾图资源网 懒人之家源码 ASP300源码 折翼天使 锦尚中国 莎莎源码论坛 吾爱源码论坛 织梦58 搜虎源码论坛 游戏咖啡屋 码农网 虎格网 织梦猫 魔克吧 忽悠兄基地

网站快速入口:| 网站首页 | 用户登录 | 快捷登录 | 注册账号 | 会员中心 |