[SOLVED] How to start a java springboot application as a sytem service in linux

Issue

This Content is from Stack Overflow. Question asked by ManojReddy

I am trying to create a systemd service for a spring boot application, servie is creating but the status shows as follows,

‚óŹ vehicle_service-0.1.0.service - vehicle micro service
   Loaded: loaded (/etc/systemd/system/vehicle_service-0.1.0.service; enabled; vendor preset: disabled)
   Active: activating (auto-restart) (Result: exit-code) since Mon 2022-09-19 05:30:50 UTC; 10s ago
  Process: 23815 ExecStart=/home/Manoj/vehicle-servive/build/libs/start.sh (code=exited, status=203/EXEC)
 Main PID: 23815 (code=exited, status=203/EXEC)

Sep 19 05:30:50 jenkins systemd[1]: Unit vehicle_service-0.1.0.service entered failed state.
Sep 19 05:30:50 jenkins systemd[1]: vehicle_service-0.1.0.service failed.



Solution

I suggest you use docker-compose
because when a docker container is up if you reboot system it is still up


This Question was asked in StackOverflow by ManojReddy and Answered by Amir It is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?