#!/bin/sh
#
# startup script for ovirt-agent
#
# chkconfig: 2345 85 20
# description: ovirt-agent
# processname: ovirt-agent
# pidfile: /var/run/tomcat.pid # config:# source function library.
. /etc/rc.d/init.d/functions
# source networking configuration.
. /etc/sysconfig/network
# check that networking is up.
export ovirt_agent_home=/opt/ovirt-agent
[ -f $ovirt_agent_home/bin/startserver.sh ] ||?exit 0 [ -f $ovirt_agent_home/bin/stopserver.sh ] ||?exit 0
# see how we were called.
case "$1" in
start)
# start daemon.
echo ?"starting ovirt-agent: "
$ovirt_agent_home/bin/startserver.sh $ovirt_agent_home/conf/ovirt-agent.xml
touch /var/lock/subsys/ovirt-agent
;;
stop)
# stop daemons.
echo ?"shutting down ovirt-agent: "
$ovirt_agent_home/bin/stopserver.sh
rm -f /var/lock/subsys/ovirt-agent
;;
restart)
$0 stop
$0 start
;;
status)
status ovirt-agent
;;
*)
echo "usage: $0 {start|stop|restart|status}"
exit 1
esac
exit 0