Skip to content

Instantly share code, notes, and snippets.

@zhouqiang-cl
Created December 25, 2019 08:07
Show Gist options
  • Save zhouqiang-cl/5dabe82bab618ae1e8fffd9b7b2b62a9 to your computer and use it in GitHub Desktop.
Save zhouqiang-cl/5dabe82bab618ae1e8fffd9b7b2b62a9 to your computer and use it in GitHub Desktop.
failure-gen.service
[Unit]
Description=failure gen service
After=syslog.target network.target
[Service]
SyslogIdentifier=failure-gen
ExecStart=/opt/onfailure-test/failure-gen /opt/onfailure-test/aaa
ExecStopPost=/bin/bash -c '/bin/systemctl status failure-gen | /usr/bin/mailx -Ssendwait -s "[failure-gen] failure notification" [email protected]'
Restart=always
RestartSec=15s
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment