I have a spring boot executable jar in a digital ocean droplet. I'm able to execute the jar using java -jar myapp.jar
Now I want to have i run as a service.
I've created the file /etc/systemd/system/myapp.service with these contents
[Unit]
Description=myapp
After=syslog.target
[Service]
User=kevin
ExecStart=/var/myapp/myapp-backend-1.0-SNAPSHOT.jar
SuccessExitStatus=143
[Install]
WantedBy=multi-user.target
Then enabled it to start at system startup
systemctl enable myapp.service
I'm now attempting to start the service
systemctl start myapp.service
But I'm getting this error
Failed to start myapp.service: Unknown unit: myapp.service See system logs and 'systemctl status myapp.service' for details.
running systemctl status myapp.service
return this:
Failed to get properties: No such interface ''