#!/bin/sh
#
# xenwebmanager:	Start/stop xenwebmanager service
#
# chkconfig:	2345 25 90
# description: XenWebManager is a web-based open source clone of Xencenter.	
#


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

start()
{
	echo -n $"Starting XenWebManager service:"
	daemon --user=xenwm  /usr/bin/xenwebmanager -daemon 
	touch /var/lock/subsys/xenwebmanager
	echo ""
}

stop()
{
	echo -n "Stopping XenWebManager service:"
	killproc xenwebmanager 
	rm -f /var/lock/subsys/xenwebmanager
	echo ""
}

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

exit 0
