#!/bin/sh
# chkconfig: 35 50 50
# description: cim_server is a tool to start or stop server for pegasus.
#****************************************************************
# *	Copyright (C) 2003, Wistron Inc.  All Rights Reserved.
# *	File Name:		cim_server
# *	Author:			Jerry Zhou
# *	Create Time: 	2003-05-14 17:57:01
# *	Last Update: 	2003-05-14 17:57:01
#****************************************************************# source function library
. /etc/rc.d/init.d/functions

case "$1" in
  start)
	cd /usr/local/share/pegasus/bin/
	rm -f /var/cache/pegasus/cimserver_start.conf /tmp/cimserver_start.conf
	killall cimserver 2>/dev/null
	./cimserver -D /usr/local/share/pegasus
	sleep 1
	touch /var/lock/subsys/cim_server
	/etc/init.d/pegasusd start 1>/dev/null 2>/dev/null
	;;
  stop)
	/etc/init.d/pegasusd stop 1>/dev/null 2>/dev/null
	echo -n "Shutting down service ..."
#	killall cimserver 2>/dev/null
	cd /usr/local/share/pegasus/bin
	./cimserver -s
	echo 
	;;
  status)
    status cimserver
    echo ""
    ;;
  *)
	echo "Usage: cim_server {start|stop|status}"
	exit 1
esac

exit 0

