Running Spring Boot applications as systemd services on Linux

1.create a file named your-app.service and locate it in /etc/systemd/system directory.

[Unit]
Description=your-app
After=syslog.target

[Service]
User=root
ExecStart=/usr/bin/java -jar /home/wwwroot/website.com/your-app-1.0.0.jar
SuccessExitStatus=143

[Install]
WantedBy=multi-user.target

2.start automatically on system boot

$ systemctl enable your-app.service

3.start and stop service

systemctl start your-app.service
systemctl stop your-app.service