linux中設置nexus開機自啟動的方法
更新時間:2024年02月27日 10:13:08 作者:嗑嗑嗑瓜子的貓
這篇文章主要介紹了linux中設置nexus開機自啟動的方法,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧
一、把nexus配置成服務
1、新建服務腳本
vim /etc/init.d/nexus
添加以下腳本內(nèi)容
#!/bin/bash #chkconfig:2345 20 90 #description:nexus #processname:nexus export JAVA_HOME=/usr/local/jdk1.8.0_60 case $1 in start) su root /usr/local/nexus-3.12.1-01/bin/nexus start;; stop) su root /usr/local/nexus-3.12.1-01/bin/nexus stop;; status) su root /usr/local/nexus-3.12.1-01/bin/nexus status;; restart) su root /usr/local/nexus-3.12.1-01/bin/nexus restart;; dump) su root /usr/local/nexus-3.12.1-01/bin/nexus dump;; console) su root /usr/local/nexus-3.12.1-01/bin/nexus console;; *) echo "Usage: nexus {start|stop|run|run-redirect|status|restart|force-reload}" esac
配置完后,保存退出
2、給新建的腳本設置執(zhí)行權限
chmod 744 /etc/init.d/nexus
3、執(zhí)行以下命令進行啟動、停止 和 重啟nexus服務
#啟動 service nexus start #停止 service nexus stop #重啟 service nexus restart #查看nexus的狀態(tài) service nexus status
二、配置nexus服務開機自啟動
#向chkconfig添加 nexus 服務的管理 chkconfig --add nexus #設置nexus服務自啟動 chkconfig nexus on #關閉nexus服務自啟動 chkconfig nexus off #刪除nexus服務在chkconfig上的管理 chkconfig –del nexus
這樣就成功配置了nexus在linux下開機自啟動
到此這篇關于linux中設置nexus開機自啟動的方法的文章就介紹到這了,更多相關linux nexus開機自啟動內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持腳本之家!
相關文章
通過 SSH 在遠程 Linux 系統(tǒng)上運行命令的方法
這篇文章主要介紹了通過 SSH 在遠程 Linux 系統(tǒng)上運行命令的方法,本文給大家介紹的非常詳細,具有一定的參考借鑒價值,需要的朋友可以參考下2019-10-10Linux實現(xiàn)數(shù)據(jù)庫定時備份方式
這篇文章主要介紹了Linux實現(xiàn)數(shù)據(jù)庫定時備份方式,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教2024-01-01本地Windows遠程桌面連接阿里云Ubuntu 16.04服務器的操作方法
這篇文章主要介紹了本地Windows遠程桌面連接阿里云Ubuntu 16.04服務器的方法,本文給大家介紹的非常詳細,具有一定的參考借鑒價值,需要的朋友可以參考下2020-02-02xshell5使用ssh連接阿里云服務器的實現(xiàn)步驟
本文主要介紹了xshell5使用ssh連接阿里云服務器的實現(xiàn)步驟,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧2022-08-08