美文网首页
liunx 环境设置 springboot 项目开机启动

liunx 环境设置 springboot 项目开机启动

作者: shangyaqi | 来源:发表于2018-10-12 10:12 被阅读18次

    1.在/etc/systemd/system/目录下新建文件springboot-test.service
    [Unit]
    Description=springboot-test
    After=syslog.target

    [Service]
    ExecStart= /usr/bin/java -jar /home/test-0.0.1-SNAPSHOT.jar

    [Install]
    WantedBy=multi-user.target

    2.systemctl start springboot-test
    或systemctl start springboot-test.service
    //设置开机自启
    systemctl status springboot-test
    或systemctl status springboot-test.service
    //设置开机自启
    systemctl enable springboot-test
    或systemctl enable springboot-test.service
    //查看日志
    journalctl -u springboot-test
    或 journalctl -u tespringboot-test.service

    相关文章

      网友评论

          本文标题:liunx 环境设置 springboot 项目开机启动

          本文链接:https://www.haomeiwen.com/subject/fbywaftx.html