标签:stat etc case export oca desc list star java_home
在/etc/init.d目录下创建nexus文件
#!/bin/bash #chkconfig:2345 20 90 #description:nexus3 #processname:nexus3 export JAVA_HOME=/usr/local/jdk case $1 in start) su root /usr/local/nexus3/bin/nexus start;; stop) su root /usr/local/nexus3/bin/nexus stop;; status) su root /usr/local/nexus3/bin/nexus status;; restart) su root /usr/local/nexus3/bin/nexus restart;; dump ) su root /usr/local/nexus3/bin/nexus dump ;; console ) su root /usr/local/nexus3/bin/nexus console ;; *) echo "require console | start | stop | restart | status | dump " ;; esac
执行命令
chmod 777 /etc/init.d/nexus chkconfig --add nexus chkconfig --list nexus
验证
service nexus start
service nexus stop
标签:stat etc case export oca desc list star java_home
原文地址:https://www.cnblogs.com/feiyun126/p/10368957.html