Created
September 26, 2013 04:53
-
-
Save philips/6710008 to your computer and use it in GitHub Desktop.
To enable notifications for e.g. the test service, add a symlink named notifier@.service in test.service.wants. This should work with any service. Credit: David Fisher
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=Etcd service notifier | |
BindsTo=%i.service | |
[Service] | |
Type=oneshot | |
RemainAfterExit=yes | |
ExecStart=/usr/bin/etcdctl set /services/%I running | |
ExecStop=/usr/bin/etcdctl set /services/%I stopped |
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=test service | |
[Service] | |
Type=oneshot | |
RemainAfterExit=yes | |
ExecStart=/bin/echo test service started | |
ExecStop=/bin/echo test service stopped |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment