run
发布于 2023-11-12 / 40 阅读
0
0

Linux centos jar 包开机自启动

Linux centos jar 包开机自启动


vi /etc/systemd/system/dog.service


[Unit]
Description = dog service
After = network.target syslog.target
Wants = network.target

[Service]
Type = simple
ExecStart = /usr/lib/jvm/java/bin/java -jar -Xms20m -Xmx20m /root/dog/dog.jar 

[Install]
WantedBy = multi-user.target


#启动服务
systemctl start dog

#设置开机自启动
systemctl enable dog

#查看状态
systemctl status dog

#重启服务
systemctl restart dog



评论