码迷,mamicode.com
首页 > 其他好文 > 详细

nexus 开机自启动

时间:2018-01-12 22:43:25      阅读:174      评论:0      收藏:0      [点我收藏+]

标签:开机自启   文件   start   chm   art   star   pos   --   bsp   

一.创建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

 

nexus 开机自启动

标签:开机自启   文件   start   chm   art   star   pos   --   bsp   

原文地址:https://www.cnblogs.com/chengjunhao/p/8277749.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!