Answer the question
In order to leave comments, you need to log in
How to properly build jar to run as a service in Linux?
I wanted to understand how to build a Java application (jar) correctly so that it runs correctly on Linux as a service (socket server)?
Answer the question
In order to leave comments, you need to log in
Ordinary roaster.
Write them a PID file.
Run with & at the end.
Monitor with monit or write init scripts/systemd units to monitor a process with this PID
write ExecStart=/usr/bin/java -jar /path/to/program.jar
Type=simple or
whatever you like in the systemd unit launch line .
This tool is just what you are looking for. In addition, it works with all init systems.
wrapper.tanukisoftware.com
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question