Last active
September 12, 2022 10:27
-
-
Save Frechet/452e3288bc8310d3a098758ca9dd7189 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# Путь /etc/systemd/system/myservice.service | |
[Unit] | |
Description=Desciption about my service | |
After=syslog.target network.target | |
[Service] | |
Type=forking | |
ExecStart=/opt/myservice/startup.sh | |
##----------- | |
##!/bin/bash | |
#cd /opt/myservice | |
#java -jar /opt/myservice/myservice-0.0.1.jar & | |
#MYSERVICE_PID=$! | |
#echo myservice is started | |
#echo $(pwd) | |
#echo --- myservice pid=$MYSERVICE_PID --- | |
#echo $MYSERVICE_PID > myservice.pid | |
#echo working... | |
##----------- | |
ExecStop=/opt/myservice/shutdown.sh | |
##----------- | |
##!/bin/bash | |
#MYSERVICE_PID=`cat myservice.pid` | |
#kill -9 $MYSERVICE_PID | |
#echo finish | |
##----------- | |
RestartSec=10 | |
Restart=always | |
[Install] | |
WantedBy=multi-user.target | |
##----------- Посмотреть логи запущенного сервиса | |
## sudo journalctl -u myservice -b | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment