#!/bin/bash # # This script runs the EventStore Meta Data service # # chkconfig: 345 05 95 if [ -z ${ESMDSHOME} ]; then echo $"The ESMDSHOME environment is not set" exit 1 fi RETVAL=$? pid=`ps auxw | grep ESMetaDataServer | grep -v grep | awk '{print $2}'` base=ESMetaDataServer case "$1" in restart) echo $"Checking for existing ESMetaDataServer..." if [ ! -z ${pid} ]; then kill -9 ${pid} fi echo $"Restart ESMetaDataServer..." nohup ${CMDSHOME}/ESMetaDataServer.py --verbose=1 --log=${CMDSHOME}/cmds.log 2>&1 1>& /dev/null < /dev/null & ;; start) if [ ! -z ${pid} ]; then kill -9 ${pid} fi nohup ${CMDSHOME}/ESMetaDataServer.py --verbose=1 --log=${CMDSHOME}/cmds.log 2>&1 1>& /dev/null < /dev/null & ;; status) if [ ! -z ${pid} ]; then echo $"${base} is running, pid=${pid}" exit 0 fi echo $"${base} is stopped" exit 3 ;; stop) if [ ! -z ${pid} ]; then kill -9 ${pid} fi ;; *) echo $"Usage: $0 {start|stop|status|restart}" exit 1 ;; esac exit $RETVAL