Created
December 26, 2013 03:43
-
-
Save harukasan/8129534 to your computer and use it in GitHub Desktop.
This file contains 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/sh | |
script_dir=$(cd $(dirname $0) && pwd) | |
norikra_dir=$(cd "$script_dir/../lib/norikra" && pwd) | |
shared_dir=$(cd "$script_dir/../shared" && pwd) | |
log_dir=/var/log/norikra | |
pid_file="$shared_dir/norikra.pid" | |
full_dir=$(cd "$norikra_dir" && pwd) | |
norikra_opts="-d --pidfile=${pid_file} --stats=${shared_dir}/norikra.json --logdir=${log_dir} --log-filesize=10MB --log-backups=10 --small" | |
java_opts="-Xmx4g -Xms4g -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -Xloggc:${log_dir}/gc.log -XX:+PrintGCDateStamps -XX:+PrintGC" | |
case "$1" in | |
start) | |
echo "starting norikra" | |
cd $full_dir && bundle exec norikra start $java_opts $norikra_opts | |
echo $? | |
;; | |
stop) | |
echo "stopping norikra" | |
cd $full_dir && bundle exec norikra stop --pidfile=$pid_file | |
echo $? | |
;; | |
*) | |
echo "Usage: norikra {start|stop}" | |
exit 1 | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment