P
P
prizrak392018-11-15 14:20:57
linux
prizrak39, 2018-11-15 14:20:57

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

4 answer(s)
S
Softer, 2018-11-15
@prizrak39

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

P
pfg21, 2018-11-15
@pfg21


write ExecStart=/usr/bin/java -jar /path/to/program.jar
Type=simple or whatever you like in the systemd unit launch line .

J
Jea P., 2018-11-22
@jea

This tool is just what you are looking for. In addition, it works with all init systems.
wrapper.tanukisoftware.com

O
Oleg A, 2018-11-15
@OLEG4120

Look at YAJSW it will help
yajsw.sourceforge.net

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question