Last active
April 30, 2021 15:06
-
-
Save johnatanbrayan/16c63a1da60fc29892373aa453a440f7 to your computer and use it in GitHub Desktop.
How to create a service on linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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