zoukankan      html  css  js  c++  java
  • nexus 开机自启动

    一.创建shell服务脚本

             创建脚本nexus,并将脚本文件放在/etc/init.d 服务启动目录

    #!/bin/bash    
    #chkconfig:2345 20 90    
    #description:nexus    
    #processname:nexus    
    export NEXUS_HOME=/opt/nexus/nexus-3.6/
    case $1 in    
            start) su root $NEXUS_HOME/bin/nexus start;;    
            stop) su root $NEXUS_HOME/bin/nexus stop;;    
            status) su root $NEXUS_HOME/bin/nexus status;;    
            restart) su root $NEXUS_HOME/bin/nexus restart;;    
            dump ) su root $NEXUS_HOME/bin/nexus dump ;; 
            console ) su root $NEXUS_HOME/bin/nexus console ;;          
            *) echo "require console | start | stop | restart | status | dump " ;;    
    esac

    二.配置权限

    chmod +x /opt/nexus/nexus-3.6/bin/nexus
    chmod +x /etc/init.d/nexus

    三. 让chkconfig 管理脚本

    #添加服务
    chkconfig --add nexus
    #开机自启动
    chkconfig nexus on

    四.启动服务

    service nexus start
  • 相关阅读:
    C#第一节课作业,HelloWorld
    C# 第四次作业
    前端浅入汇总
    对象——浅识
    CSS圆角
    javascript中工厂模式
    C#中抽象类
    ASP.NET新知识
    ReSharper快捷键
    JS调用webservice
  • 原文地址:https://www.cnblogs.com/chengjunhao/p/8277749.html
Copyright © 2011-2022 走看看