title
菜鸟吧 首页 站长学堂 建站教程 查看内容

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

2024-09-21 19:12| 发布者: admin| 查看: 2| 评论: 0|原作者: 菜鸟哥

摘要: 内容教程开始1:新建一个shell脚本执行以下代码 或者进面板 把以下代码丢到计划任务里的shell脚本执行#!/bin/bash PATH=/bin:/sbin:/usr/bin:/usr/sbin……

内容

教程开始

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

路过

雷人

握手

鲜花

鸡蛋

最新评论

Archiver 手机版 小黑屋 网站地图

Copyright © 2015-2026 菜鸟吧论坛 |找资源研究学习当然上菜鸟吧论坛

警告:本站所有资源收集世界互联网,请下载后24小时之内删除,否則後果自負!
WARNING: ‌All resources from the web. Delete within 24 hours or consequences at your own risk!
郑重声明:站内所有资源均来自互联网或会员投稿发布, 如果侵犯了权益请联系删除,E-mail:cainiaovip8@qq.com 商用请购买正版。

返回顶部