HTS-一键启动

#!/bin/bash
#program:runall and checkall process
#author:sundz 20220606 v1
如果此用户不存在这个,则配置为1
aboss5_flag=0
aboss2_flag=0
mycat_flag=0
mysql_flag=0
Svn_flag==0

procmgr-aboss5 start
procmgr5_ids=ps x | grep procmgr | grep -v "grep" | awk '{print $1}'
for id in $procmgr5_ids
do
        pathDir=ls -al /proc/$id/cwd | awk '{print $NF}'
        echo [$id]:[$pathDir]
        if [[ "$pathDir" == *"aboss5"* ]]; then
                aboss5_flag=1
                echo "[NOTE] aboss5 procmgr is already started."
        fi
done

procmgr-aboss2 start
procmgr2_ids=ps x | grep procmgr | grep -v "grep" | awk '{print $1}'
for id in $procmgr2_ids
do
        pathDir=ls -al /proc/$id/cwd | awk '{print $NF}'
        echo [$id]:[$pathDir]
        if [[ "$pathDir" == *"aboss2"* ]]; then
                aboss2_flag=1
                echo "[NOTE] aboss2 procmgr is already started."
        fi
done

aboss5 procmgr start
if [ "$aboss5_flag" == "0" ]; then
        cd ~/aboss5/bin
        ./procmgr -d&
fi

aboss2 procmgr start
if [ "$aboss2_flag" == "0" ]; then
        cd ~/aboss2/bin
#       export LC_ALL="zh_CN.GBK"
        ./procmgr -d&
fi

Mycat startup
if [ "$mycat_flag" == "0" ]; then
        mycat_id=ps x | grep mycat | grep -v "grep" | awk '{print $1}'
        if [ -z "$mycat_id" ]; then
                cd ~/mycat/bin
                ./mycat start
        else
                mycat_flag=1
                echo "[NOTE] Mycat is already started."
        fi
fi

Mysql startup
if [ "$mysql_flag" == "0" ]; then
        mysql_id=ps x | grep mysql | grep -v "grep" | awk '{print $1}'
        if [ -z "$mysql_id" ]; then
                echo "[ERROR] Mysql is not running!!!!."
        else
                mysql_flag=1
                echo "[NOTE] Mysql is already started."
        fi
fi

Svn startup
if [ "$Svn_flag" == "0" ]; then
        Svn_id=ps x | grep Svn | grep -v "grep" | awk '{print $1}'
        if [ -z "$Svn_id" ]; then
                echo "[ERROR] Svn is not running!!!!."
        else
                Svn_flag=1
                echo "[NOTE] Svn is already started."
        fi
fi

Original: https://www.cnblogs.com/sunfankun/p/16553424.html
Author: 孙犯困
Title: HTS-一键启动

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/583098/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

  • windows 挂载 NFS共享

    实验环境: NFS主机(192.168.18.10):CentOS7.0 软件包:nfs-utils、rpcbind; 客户机(192.168.18.41):windows ser…

    Linux 2023年5月27日
    0200
  • 从台积电增产28纳米产线看袁项之争

    由台积电增建南京28纳米产线引发的袁项之争,他们的观点和论据,我总结一下,大致如下: 袁:引进外资,鼓励竞争,产生鲶鱼效应,让芯片代工产业快速活跃起来,百花齐放,消费者受益。并举了…

    Linux 2023年6月6日
    079
  • exec

    exec 函数 exec()函数通过运行其他程序来替换当前进程。 新程序启动后PID和老程序一样,就像两个程序接力跑,你的程序把进程交接给了新程序。 exec函数众多,可以分为两种…

    Linux 2023年6月7日
    088
  • short, int, long, long long各个类型的范围

    类型名称 字节数 取值范围 signed char 1 -2^7 ~ 2^7-1 -128~+127 short int 2 -2^14 ~ 2^14-1 -32768~+3276…

    Linux 2023年6月8日
    071
  • Redis基础

    1.简介 Redis (远程字典服务器)是一 个开源的、使用C语言编写的NoSQL数据库。Redis基于内存运行并支持持久化,采用 key-value (键值对)的存储形式,是目前…

    Linux 2023年6月13日
    076
  • Linux tcpdump抓包命令排查

    bash;gutter:true; tcpdump命令行参数介绍:</p> <p>-A 以ASCII格式打印出所有分组,并将链路层的头最小化。 -c 在收到…

    Linux 2023年6月13日
    082
  • redisobject详解

    typedef struct redisObject { unsigned type:4; unsigned encoding:4; unsigned lru:REDIS_LRU_…

    Linux 2023年5月28日
    095
  • JDK8以上提高开发效率

    1 接口的默认方法和静态方法 1.1 接口中可以定义默认方法和静态方法。 默认方法使用default修饰,静态方法和默认方法可以多个; 静态方法通过接口直接调用,默认方法通过接口实…

    Linux 2023年6月13日
    086
  • 学习一下 Spring Security

    一、Spring Security 1、什么是 Spring Security? (1)基本认识Spring Security 是基于 Spring 框架,用于解决 Web 应用安…

    Linux 2023年6月11日
    084
  • 自动升级shell

    make_version.sh ./make_version.sh 第一次提示”y/N” 表示接下来的操作是手动(y)还是自动(N); 自动(N)会为镜像自…

    Linux 2023年5月28日
    093
  • kafka 在 zookeeper 中保存的数据内容

    转载请注明出处: 服务器上下载 kafka : wget https://archive.apache.org/dist/kafka/2.4.0/kafka_2.12-3.2.0….

    Linux 2023年6月14日
    083
  • Redis 基础

    Redis 基础 Redis 定位 – 特性 关系型数据库 特性 非关系型数据库 特性 Redis 特性 Redis 安装 – 启动 – 使用 …

    Linux 2023年6月13日
    0103
  • Redis Sentinel实现的机制与原理详解

    Redis-Sentinel是Redis官方推荐的高可用性(HA)解决方案。实际上这意味着你可以使用Sentinel模式创建一个可以不用人为干预而应对各种故障的Redis部署。 它…

    Linux 2023年5月28日
    0103
  • Linux快速安装流量监控工具(实用版)

    前言: Linux流量监控工具,在此我推荐两种分别为: 1、nload(推荐)因为个人看着舒服点😂 2、iftop 你可以选择上面两种中的任何一种。下面是这两个版本的简介和安装教程…

    Linux 2023年5月27日
    076
  • BGP路由衰减

    路由不稳定的主要表现形式是路由振荡(Route Flapping),即路由表中的某条路由反复消失和重现。 发生路由振荡时,路由器就会向邻居发布路由更新,收到更新报文的路由器需要重新…

    Linux 2023年6月13日
    089
  • Linux 配置Git

    前言:请各大网友尊重本人原创知识分享,谨记本人博客: 南国以南i 一、用git –version命令检查是否已经安装 二、下载git源码并解压 wget https:/…

    Linux 2023年5月27日
    0119
亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球