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 自动启动

  • 相关阅读:
    技术晨读_2015_11_29
    mysql的timeout
    Gradle目录解析
    flexbox简介
    elasticsearch 查询(match和term)
    内存那些事
    elasticsearch 文档
    elasticsearch 集群
    elasticsearch中的API
    小菜的程序员道路(三)
  • 原文地址:https://www.cnblogs.com/qiangyuzhou/p/11776373.html
Copyright © 2011-2022 走看看