当前位置:   article > 正文

CentOS 7.x 下 Nexus 3.x 添加开机启动_nexus开机自动启动怎么设置

nexus开机自动启动怎么设置

官方文档

  • 安装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 //启动服务

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

闽ICP备14008679号