Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

riak leveldb fix #92

Merged
merged 1 commit into from
Oct 29, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion conf/application-production.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions src/debian/DEBIAN/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
39 changes: 18 additions & 21 deletions src/templates/start
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,28 @@
description "REST based API server - Gateway for Megam."
author "Rajthilak <rajthilak@megam.co.in>"

# 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