当前位置:   article > 正文

【Nexus】--设置开机自启动_windows nexus开机自动启动怎么设置

windows nexus开机自动启动怎么设置

接上文《基于CentOS6.5安装Nexus》

1、新建nexus启动脚本

进入/etc/init.d目录,新建脚本文件nexus

​# vim /etc/init.d/nexus

脚本内容

  1. #!/bin/bash
  2. #chkconfig:2345 20 90
  3. #description:nexus
  4. #processname:nexus
  5. export JAVA_HOME=/opt/server/jdk1.8.0_51
  6. case $1 in
  7. start) su root /usr/local/nexus-3.14.0-04/bin/nexus start;;
  8. stop) su root /usr/local/nexus-3.14.0-04/bin/nexus stop;;
  9. status) su root /usr/local/nexus-3.14.0-04/bin/nexus status;;
  10. restart) su root /usr/local/nexus-3.14.0-04/bin/nexus restart;;
  11. dump) su root /usr/local/nexus-3.14.0-04/bin/nexus dump;;
  12. console) su root /usr/local/nexus-3.14.0-04/bin/nexus console;;
  13. *) echo "Usage: nexus {start|stop|run|run-redirect|status|restart|force-reload}"
  14. esac

2、给脚本设置权限

# chmod +x /etc/init.d/nexus

3、使用service命令使用nexus

  1. # service nexus status
  2. WARNING: ************************************************************
  3. WARNING: Detected execution as "root" user. This is NOT recommended!
  4. WARNING: ************************************************************
  5. nexus is running.

4、添加到开机启动

# chkconfig --add nexus

5、查看nexus开机启动

  1. # chkconfig --list nexus
  2. nexus 0:off 1:off 2:on 3:on 4:on 5:on 6:off

 

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/花生_TL007/article/detail/124745
推荐阅读
相关标签
  

闽ICP备14008679号