Last active
November 30, 2019 21:27
-
-
Save alistairtweed/c7bc651997cfd5b587307bde69a6fdad to your computer and use it in GitHub Desktop.
systemd Startup Script
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
[Unit] | |
Description=<description> | |
[Service] | |
Type=<type:forking,oneshot...> | |
User=<user> | |
WorkingDirectory=<absolute path to working directory> | |
Environment=<environment variable> | |
ExecStart=/bin/bash <script to run on start> | |
ExecStop=/bin/bash <script to run on stop> | |
ExecReload=/bin/bash <script to run on reload> | |
Restart=<restart:on-failure,always...> | |
[Install] | |
WantedBy=multi-user.target |
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
sudo systemctl daemon-reload | |
sudo systemctl enable my_service.service | |
sudo systemctl disable my_service.service | |
sudo systemctl start my_service.service | |
sudo systemctl stop my_service.service | |
sudo systemctl restart my_service.service | |
sudo systemctl reload my_service.service |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment