Skip to content

Instantly share code, notes, and snippets.

@r4rohan
Created August 16, 2021 10:52
Show Gist options
  • Save r4rohan/ebce857090fb58ad380efc2b76636dfc to your computer and use it in GitHub Desktop.
Save r4rohan/ebce857090fb58ad380efc2b76636dfc to your computer and use it in GitHub Desktop.
[Unit]
Description=Hello World Spring Boot Demo Service
[Service]
User=ubuntu
#change this to your workspace
WorkingDirectory=/home/ubuntu/exec-script
#path to executable
#executable is a bash script which calls jar file
ExecStart=/home/ubuntu/exec-script/hello-world
SuccessExitStatus=143
TimeoutStopSec=10
# asking systemd to always restart the service if program exits for whatever reason
Restart=always
# restart time
RestartSec=1
# asking systemd to attempt to always restart your service
StartLimitIntervalSec=0
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment