Skip to content

Instantly share code, notes, and snippets.

@circa10a
Last active March 10, 2022 15:48
Show Gist options
  • Save circa10a/e6cfc673af9282d17dfb958ef6adabeb to your computer and use it in GitHub Desktop.
Save circa10a/e6cfc673af9282d17dfb958ef6adabeb to your computer and use it in GitHub Desktop.
A Simple Systemd Service
#/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
@bahner
Copy link

bahner commented Jan 29, 2020

Missing a "t" at the end.

@circa10a
Copy link
Author

@bahner thanks for the catch, fixed it.

@karl-cardenas-coding
Copy link

Here I am googling a simple service definition and look who the owner is @circa10

@circa10a
Copy link
Author

circa10a commented Jun 10, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment