Subversion Repositories SmartDukaan

Rev

Rev 4716 | Blame | Compare with Previous | Last modification | View Log | RSS feed

#!/bin/bash

LOG_DIR="/var/log/services"

case "$1" in
start)

        cd /root/solr/example
        `java -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -jar start.jar >> ${LOG_DIR}/solr.log 2>&1 &`
        ;;
stop)
        `ps aux | grep "start.jar" | grep -v "grep" | awk '{print $2}' | xargs kill -9`
        ;;
restart)
        cd /root/solr/example
        `ps aux | grep "start.jar" | grep -v "grep" | awk '{print $2}' | xargs kill -9`
        `java -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -jar start.jar >> ${LOG_DIR}/solr.log 2>&1 &`
        ;;
*)
        echo "Usage: $0 { start | stop }"
        exit 1
        ;;
esac
exit 0