zoukankan      html  css  js  c++  java
  • 开机启动自己的服务

    #!/bin/sh  
      
    #add for chkconfig  
    #chkconfig: 2345 70 30  
    #description: the description of the shell   #启动MQANT服务
    #processname: andyStart  :                  #第一个进程名,后边设置自启动的时候会用到  
      
    
    #1. vi /etc/init.d/mqant
    #2. paste shell content
    #3. chmod +x /etc/init.d/mqant
    #4. chkconfig mqant on 
    #5. service mqant start
      
    #下面要启动服务的命令 
    #/usr/local/vevigame/veviserver/bin/server --conf /usr/local/vevigame/veviserver/bin/conf/serverl.conf
    
    #PT=/usr/local/vevigame/veviserver/bin
    
    #EXEC=/usr/local/vevisoft/mqantserver/bin/server
    #CONF=/usr/local/vevisoft/mqantserver/bin/conf/serverl.json
    #LOG=/usr/local/vevisoft/mqantserver/bin/logs
    
    EXEC=/usr/local/vevigame/mqantserver/bin/server
    CONF=/usr/local/vevigame/mqantserver/bin/conf/serverl.json
    LOG=/usr/local/vevigame/mqantserver/bin/logs
    
    case $1 in
    	start)
    		if [ -f $EXEC ]
    		then 
    			echo "$EXEC exists! server is starting..."
    			nohup $EXEC --conf $CONF --log $LOG &
    			echo "server start success"
    		else 
    			echo "ERROR:$EXEC not exists ,server can not start..."
    		fi
    		;;
    	stop)
    		kill -9 $(ps -ef|grep -v grep|grep '--conf')
    
    		if [ $? -eq 0 ]
    		then
    		   echo "mqant is stop..."
    		   #killall -9 $PID
    		else
    		   echo "ERROR:mqant is not stop,there is something errors!"
    		fi
    		;;
    	exit)
    		pid=$(ps -ef|grep -v grep|grep '--conf')
    		for i in $pid
    		do
    			echo "Kill the $1 process [$i]"
    			kill -9 $i
    		done
    		;;
    	restart|force-reload)  
            ${0} stop  
            ${0} start  
            ;;  
      *)  
    		echo "Usage: $name [start|stop|restart]"  
    		exit 1
    		;;
     esac
     exit 0
     
     #kill -9 $(ps -ef|grep -v grep|grep '--conf')
    

      

  • 相关阅读:
    5.2 HTML5表单与PHP交互
    5.1 HTML5表单的创建
    4.3 HTML5布局的使用
    MATLAB矩阵——2.5稀疏矩阵
    MATLAB矩阵——2.4矩阵的特征值与特征向量
    MATLAB矩阵——2.3矩阵求值
    MATLAB矩阵处理——2.2矩阵变换
    MATLAB矩阵处理——2.1特殊矩阵
    MATLAB基础知识——1.6基本运算
    MATLAB基础知识——1.5矩阵元素的引用
  • 原文地址:https://www.cnblogs.com/veviDP/p/9559766.html
Copyright © 2011-2022 走看看