基于Linux的Systemd部署
jar: springboot-test.jar
jar所在目录 /opt
在/etc/systemd/system/目录下新建文件springboot-test.service
[Unit] Description=test After=syslog.target [Service] ExecStart= java -jar /opt/springboot-test.jar [Install] WantedBy=multi-user.target
然后
systemctl daemon-reload
启动:
systemctl start springboot-test
停止:
systemctl stop springboot-test
服务状态:
systemctl status springboot-test
开机启动:
systemctl enable springboot-test