Skip to content

Instantly share code, notes, and snippets.

@mylxsw
Created April 2, 2018 06:15
Show Gist options
  • Save mylxsw/d4847c55c44dd545276fb8e1480d3fce to your computer and use it in GitHub Desktop.
Save mylxsw/d4847c55c44dd545276fb8e1480d3fce to your computer and use it in GitHub Desktop.
monitoring supervisor FATAL task, and restart it automatically
#!/usr/bin/env bash
supervisorctl status | grep FATAL | awk '{print $1}' | awk -F ':' '{print $1 ":*"}' | uniq | xargs -I {} supervisorctl restart {}
@mylxsw
Copy link
Author

mylxsw commented Apr 2, 2018

cron task

*/10 * * * * root supervisorctl status | grep FATAL | awk '{print $1}' | awk -F ':' '{print $1 ":*"}' | uniq | xargs -I {} supervisorctl status {} >> /var/log/supervisor-watcher.log 2>&1

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