Cent OS 7.x 下 Nexus 3.x 添加開機啓動

  • 安裝nexus,這裏就不贅述,本文主要講述開機啓動項配置
    1.vim 打開 nexus 入口程序文件
    在這裏插入圖片描述
    2.配置JDK目錄,原本是註釋了的,需要放開進行配置,保存退出
    在這裏插入圖片描述
    3.創建nexus服務配置文件
    vim /etc/systemd/system/nexus.service
    在這裏插入圖片描述
    輸入以下內容,紅色部分自行調整
    在這裏插入圖片描述
    [Unit]
    Description=nexus service
    After=network.target

    [Service]
    Type=forking
    LimitNOFILE=65536
    ExecStart=/usr/local/nexus/nexus-3.9.0-01/bin/nexus start
    ExecStop=/usr/local/nexus/nexus-3.9.0-01/bin/nexus stop
    User=nexus
    Restart=on-abort

    [Install]
    WantedBy=multi-user.target

4.刷新 系統配置文件,開啓自啓動

sudo systemctl daemon-reload // 刷新配置
sudo systemctl enable nexus.service //設置自啓動
sudo systemctl start nexus.service //啓動服務

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章