zoukankan      html  css  js  c++  java
  • shell脚本进行设置启动/关闭

    vi /etc/init.d/confluence

    -----------------------------

    #!/bin/bash
    # chkconfig: 2345 85 15
    # Provides: atlassian
    # Short-Description: Start and stop the Jira&Confluence server
    # Description: Start and stop the Jira&Confluence server.

    # source function library
    ./etc/init.d/functions

    Confluence=/home/atlassian/confluence

    startup=$Confluence/bin/startup.sh

    shutdown=$Confluence/bin/shutdown.sh

    export JAVA_HOME=/home/java/jdk1.8.0_181

    start(){
    echo -n $"Starting Confluence"
    #daemon -c
    $startup
    RETVAL=$?
    echo
    }
    stop(){
    echo $"Stopping Confluence"
    $shutdown
    RETVAL=$?
    echo
    }
    restart(){
    stop
    start
    }
    status(){
    numproc=`ps -ef | grep confluence | grep -v "grep confluence" | wc -l`
    if [ $numproc -gt 0 ]; then
    echo "Confluence is running..."
    else
    echo "Confluence is stopped..."
    fi
    }
    # See how we were called.

    case "$1" in
    start)
    start
    ;;
    stop)
    stop
    ;;
    status)
    status
    ;;
    restart)
    restart
    ;;
    *)
    echo $"Usage: $0 {start|stop|status|restart}"
    exit 1
    esac
    exit 0

    ---------------------------

    需要对 文件赋可执行权限

    chmod +x /etc/init.d/confluence

    cd /etc/init.d

    添加服务

    chkconfig --add confluence

    查看confluence服务启动级别

    chkconfig --list

    保证2-5开启

    chkconfig -s confluence on

    测试启动confluence

    service confluence start

    重启centos

    reboot

    confluence 自动启动

  • 相关阅读:
    广播与服务知识点总结
    Intent和Activity知识点总结
    数据库基础
    Java 中JOptionPane的基本使用方法
    Eclipse 自动补全功能失效解决办法及修改快捷键方法
    hdu 2095 find your present (2)
    sort()
    qsort()
    算法学习——分治算法
    NYOJ——街区最短路径问题
  • 原文地址:https://www.cnblogs.com/qiangyuzhou/p/11776373.html
Copyright © 2011-2022 走看看