Skip to content

Instantly share code, notes, and snippets.

@philips
Created September 26, 2013 04:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philips/6710008 to your computer and use it in GitHub Desktop.
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
[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
[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