As per spring-boot deployment,
A fully executable jar can be executed like any other executable binary or it can be registered with init.d
or systemd
Make sure you build your app using the plug-in below (gradle version in shared link):
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<executable>true</executable>
</configuration>
</plugin>
and as shown by Jörg, create a symbolic link inside init.d:
sudo ln -s /var/myapp/myapp.jar /etc/init.d/myapp
That is the simplified version :)
More to your question, you need to customize the init and this can be done by a conf
file - all specified in the documentation.
With the exception of JARFILE
and APP_NAME
, the settings can be
configured using a .conf file. The file is expected next to the jar
file and have the same name but suffixed with .conf rather than .jar.
For example, a jar named /var/myapp/myapp.jar will use the
configuration file named /var/myapp/myapp.conf.
such as:
myapp.conf
JAVA_OPTS=-Xmx1024M
LOG_FOLDER=/custom/log/folder