Skip to content

Instantly share code, notes, and snippets.

@johnko
Created May 30, 2015 19:57
Show Gist options
  • Save johnko/71cb7c05e945d915e837 to your computer and use it in GitHub Desktop.
Save johnko/71cb7c05e945d915e837 to your computer and use it in GitHub Desktop.
couch-start.sh
#!/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
#!/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
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