赞
踩
接上文《基于CentOS6.5安装Nexus》
进入/etc/init.d目录,新建脚本文件nexus
# vim /etc/init.d/nexus
脚本内容
- #!/bin/bash
-
- #chkconfig:2345 20 90
- #description:nexus
- #processname:nexus
-
- export JAVA_HOME=/opt/server/jdk1.8.0_51
-
- case $1 in
- start) su root /usr/local/nexus-3.14.0-04/bin/nexus start;;
- stop) su root /usr/local/nexus-3.14.0-04/bin/nexus stop;;
- status) su root /usr/local/nexus-3.14.0-04/bin/nexus status;;
- restart) su root /usr/local/nexus-3.14.0-04/bin/nexus restart;;
- dump) su root /usr/local/nexus-3.14.0-04/bin/nexus dump;;
- console) su root /usr/local/nexus-3.14.0-04/bin/nexus console;;
- *) echo "Usage: nexus {start|stop|run|run-redirect|status|restart|force-reload}"
- esac
# chmod +x /etc/init.d/nexus
- # service nexus status
- WARNING: ************************************************************
- WARNING: Detected execution as "root" user. This is NOT recommended!
- WARNING: ************************************************************
- nexus is running.
# chkconfig --add nexus
- # chkconfig --list nexus
- nexus 0:off 1:off 2:on 3:on 4:on 5:on 6:off
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。