Skip to content

Instantly share code, notes, and snippets.

@johnatanbrayan
Last active April 30, 2021 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnatanbrayan/16c63a1da60fc29892373aa453a440f7 to your computer and use it in GitHub Desktop.
Save johnatanbrayan/16c63a1da60fc29892373aa453a440f7 to your computer and use it in GitHub Desktop.
How to create a service on linux
# How to create a service on linux:
cd /etc/systemd/system
vim application.service
################# Template to create a Service on linux #################
[Unit]
Description=Desafio Spring Boot application
After=syslog.target
[Service]
User=quality
WorkingDirectory=/opt/jh/desafio
ExecStart=/usr/bin/java -jar /opt/jh/desafio/desafio.jar --server.port=8090 SuccessExitStatus=143
[Install]
WantedBy=multi-user.target
#########################################################################
# Commands to see and restart a service
sudo systemctl enable aplication.service
sudo systemctl daemon-reload
sudo systemctl start johnatan
sudo systemctl status johnatan
systemctl list-unit-files | grep enabled
**Link: digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units-pt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment