Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Start a jar file like service in linux [closed]

I want to start and stop my jar file as follows

service myService start

service myService stop

my current jar file running as follows

cd /home/alex/IdeaProjects/myService java -jar target/myService-SNAPSHOT-1.jar server config.yml 

What should I do?

like image 490
Alex Mathew Avatar asked Feb 04 '14 07:02

Alex Mathew


1 Answers

You need a Service Wrapper to run the Jar file.

There are examples and instructions for init.d here. or for systemd (ubuntu 16+) here

like image 183
PbxMan Avatar answered Sep 19 '22 18:09

PbxMan