Created
May 30, 2015 19:57
-
-
Save johnko/71cb7c05e945d915e837 to your computer and use it in GitHub Desktop.
couch-start.sh
This file contains hidden or 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
#!/bin/bash | |
# from https://gist.github.com/cpetersen/581657 | |
NAME=$1 | |
HOME="/root" | |
PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" | |
/usr/bin/sudo -u root /usr/local/bin/couchdb -b -a /mnt/sde/$NAME/couchdb.ini -p /var/run/couchdb-$NAME.pid -e /var/log/couchdb-$NAME.err -o /var/log/couchdb-$NAME.out | |
sleep 1 | |
echo '' >> /var/run/couchdb-$NAME.pidroot |
This file contains hidden or 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
#!/bin/bash | |
# from https://gist.github.com/cpetersen/581657 | |
NAME=$1 | |
HOME="/root" | |
PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" | |
/usr/bin/sudo -u root /usr/local/bin/couchdb -d -a /mnt/sde/$NAME/couchdb.ini -p /var/run/couchdb-$NAME.pid -e /var/log/couchdb-$NAME.err -o /var/log/couchdb-$NAME.out |
This file contains hidden or 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
check process couchdb-instance1 with pidfile /var/run/couchdb-instance1.pid | |
group couch | |
start program = "/bin/couchdb-start.sh instance1" timeout 90 seconds | |
stop program = "/bin/couchdb-stop.sh instance1" | |
if failed url http://localhost:5984/ and content == '"couchdb"' then restart | |
if 3 restarts within 5 cycles then timeout |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment