springboot开机自启

编写service脚本

vim /etc/systemd/system/transform.service

1
2
3
4
5
6
7
8
9
10
[Unit]
Description= transform service
Documentation=transform service
After=network-online.target firewalld.service
Wants=network-online.target

[Service]
ExecStart=/opt/jdk/jdk1.8.0_301/bin/java -jar /opt/transform/transform-0.0.1-SNAPSHOT.jar
[Install]
WantedBy=multi-user.target

启动服务

systemctl start transform

停止服务

systemctl stop transform

开机自启

systemctl enable transform

取消开机自启

systemctl disable transform


springboot开机自启
https://zhaops-hub.github.io/2021/11/03/java/springboot开机自启/
作者
赵培胜
发布于
2021年11月3日
许可协议