#!/bin/sh
#
# hrnservice        Starts hrnservice.
#
# chkconfig: 2345 88 12
# description:  hrnservice sends the log messages to the system logger.

LD_LIBRARY_PATH=/opt/hitachi/hrn/lib
export LD_LIBRARY_PATH

# Source function library.
. /etc/rc.d/init.d/functions

# Install
[ -f /opt/hitachi/hrn/hrnservice ] || exit 0

RETVAL=0

start() {
	echo -n "Starting hrnservice: "

	daemon /opt/hitachi/hrn/hrnservice
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/hrnservice
	return $RETVAL
}	
stop() {

	echo -n "Shutting down hrnservice: "
	killproc hrnservice
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/hrnservice
	return $RETVAL
}
restart() {
	stop
	start
}	

case "$1" in
  start)
  	start
	;;
  stop)
  	stop
	;;
  status)
  	status hrnservice
	;;
  restart|reload)
  	restart
	;;
  condrestart)
  	[ -f /var/lock/subsys/hrnservice ] && restart || :
	;;
  *)
	echo "Usage: hrnservice {start|stop|status|restart|condrestart}"
	exit 1
esac

exit $?

