-
-
Save h0rn3t/fd42a5521b59a3960e147d8a05f12ca4 to your computer and use it in GitHub Desktop.
A Simple Systemd Service
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/test.service | |
[Unit] | |
Description=Test Systemd Service | |
[Service] | |
ExecStartPre=/usr/bin/echo -e "\033[0;33m Pre start \033[0m" | |
ExecStart=/usr/bin/sleep 10 | |
ExecStartPost=/usr/bin/echo -e "\033[0;33m Post start \033[0m" | |
ExecStop=/usr/bin/pkill -f sleep | |
ExecStopPost=/usr/bin/echo -e "\033[0;33m Post stop \033[0m" | |
Restart=always | |
RestartSec=5 | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment