You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my use case, I was replacing the old init.d launch script inserted at the start of the jar so I ended up with two changes to the documentation sample. First I ended up changing ExecStart to ExecStart=/path/to/java/home/bin/java -jar /var/myapp/myapp.jar. Second I had to add the working directory to the service section with WorkingDirectory=/var/myapp since the init.d script sets the working directory. The working directory is important if you are loading configuration from disk using yaml or properties files in a config directory under the app directory.
I'll also say that the ExecStop=/bin/kill -15 $MAINPID option duplicates functionality of Systemd since it sends the TERM signal to all processes in the cgroup and in fact it will receive two TERM signals since ExecStop is executed and then the KillMode and KillSignal settings default to sending TERM anyways.
Spring Boot Version:
3.2.10
Systemd Version (RHEL 8):
systemd 239 (239-82.el8_10.1)
The text was updated successfully, but these errors were encountered:
The sample systemd configuration in https://github.com/spring-projects/spring-boot/blob/main/spring-boot-project/spring-boot-docs/src/docs/antora/modules/how-to/pages/deployment/installing.adoc does not work due to Systemd requirements on ExecStart. With the current sample, Systemd reports
Neither a valid executable name nor an absolute path: ${JAVA_HOME}/bin/java
. Systemd requires the first argument to be an absolute path to an executable or simple file name that will be resolved using a systemd compiled search path. I guess in newer versions of Systemd 250+ you can use ExecSearchPath to alter this path as well.In my use case, I was replacing the old init.d launch script inserted at the start of the jar so I ended up with two changes to the documentation sample. First I ended up changing ExecStart to
ExecStart=/path/to/java/home/bin/java -jar /var/myapp/myapp.jar
. Second I had to add the working directory to the service section withWorkingDirectory=/var/myapp
since the init.d script sets the working directory. The working directory is important if you are loading configuration from disk using yaml or properties files in a config directory under the app directory.I'll also say that the
ExecStop=/bin/kill -15 $MAINPID
option duplicates functionality of Systemd since it sends the TERM signal to all processes in the cgroup and in fact it will receive two TERM signals since ExecStop is executed and then the KillMode and KillSignal settings default to sending TERM anyways.Spring Boot Version:
3.2.10
Systemd Version (RHEL 8):
The text was updated successfully, but these errors were encountered: