public
Last active

  • Download Gist
/bin/couch-start.sh
Shell
1 2 3 4 5 6 7
#!/bin/bash
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/couch-stop.sh
Shell
1 2 3 4 5
#!/bin/bash
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
/etc/monit.d/couchdb
1 2 3 4 5 6
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

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.