From 7bb8e9981a618de6dbea18f4c2bc45dda6ee3d0c Mon Sep 17 00:00:00 2001 From: Thomas Alrin Date: Thu, 25 Sep 2014 20:16:04 +0530 Subject: [PATCH] riak leveldb fix --- conf/application-production.conf | 3 ++- src/debian/DEBIAN/postinst | 3 +++ src/templates/start | 39 +++++++++++++++----------------- 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/conf/application-production.conf b/conf/application-production.conf index ada75a5..664410f 100644 --- a/conf/application-production.conf +++ b/conf/application-production.conf @@ -62,7 +62,8 @@ sf.port=7609 # RabbitMQ configuration (We'll use Rabbit MQ) # ~~~~~ -amqp.url = "amqp://rabbitmq1.megam.co.in:5672/vhost" +#amqp.url = "amqp://rabbitmq1.megam.co.in:5672/vhost" +amqp.url = "amqp://localhost:5672/vhost" amqp.node.queue.prefix=megam amqp.node.exchange.prefix=megam amqp.routing.key=megam_key diff --git a/src/debian/DEBIAN/postinst b/src/debian/DEBIAN/postinst index 50a10e1..d0b8d61 100644 --- a/src/debian/DEBIAN/postinst +++ b/src/debian/DEBIAN/postinst @@ -32,6 +32,9 @@ fi [ -f /var/run/megamgateway ] && rm -rf /var/run/megamgateway +storage_backend = leveldb + +sed -i 's/^[ \t]*storage_backend .*/storage_backend = leveldb/' /etc/riak/riak.conf initctl reload-configuration diff --git a/src/templates/start b/src/templates/start index c2c85c8..363c269 100644 --- a/src/templates/start +++ b/src/templates/start @@ -3,31 +3,28 @@ description "REST based API server - Gateway for Megam." author "Rajthilak " -# Stanzas -# -# Stanzas control when and how a process is started and stopped -# See a list of stanzas here: http://upstart.ubuntu.com/wiki/Stanzas#respawn - -# When to start the service -start on runlevel [2345] -start on (started networking) +start on (local-filesystems) +stop on runlevel [!12345] + +pre-start script + riak stop + ulimit -n 65536 + riak start + echo "[`date -u +%Y-%m-%dT%T.%3NZ`] megamgateway starting" >> /var/log/megam/megamgateway/megamgateway.log + cd /usr/share/megam/megamgateway +end script -# When to stop the service -stop on runlevel [016] -stop on (stopping networking) -# Automatically restart process if crashed. Tries 0 times every 60 seconds respawn -respawn limit 0 60 -# set the working directory of the job processes -chdir /usr/share/megam/megamgateway +script + echo $$ > /var/run/megam/megamgateway/megamgateway.pid + exec ./bin/megamgateway +end script -# changes to the user and group before running the job's process -setuid root +post-stop script + rm /var/run/megam/megamgateway/megamgateway.pid + echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Stopping" >> /var/log/megam/megamgateway/megamgateway.log +end script -# start the megamgateway -script - exec ./bin/megamgateway -end script