#!/bin/sh
#***********************************************************************************
#  This file is part of FTB (Fault Tolerance Backplance) - the core of CIFTS
#  (Co-ordinated Infrastructure for Fault Tolerant Systems)
#  
#  See http://www.mcs.anl.gov/research/cifts for more information.
#  	
#
#  FTB_Version: 0.6.2
#  FTB_API_Version: 0.5
#  FTB_Heredity:FOSS_ORIG
#  FTB_License:BSD
#
#  This software is licensed under BSD. See the file FTB/misc/license.BSD for
#  complete details on your rights to copy, modify, and use this software.
#***********************************************************************************

#***************************************************************************
# ZEPTOOS:zepto-info
#      This file is part of ZeptoOS: The Small Linux for Big Computers.
#      See www.mcs.anl.gov/zeptoos for more information.
# ZEPTOOS:zepto-info
#
# ZEPTOOS:zepto-fillin
#      $Id: rc.zoid,v 1.4 2007/06/26 23:15:44 iskra Exp $
#      ZeptoOS_Version: 1.2
#      ZeptoOS_Heredity: FOSS_ORIG
#      ZeptoOS_License: GPL
# ZEPTOOS:zepto-fillin
#
# ZEPTOOS:zepto-gpl
#       Copyright: Argonne National Laboratory, Department of Energy,
#                  and UChicago Argonne, LLC.  2004, 2005, 2006, 2007
#       ZeptoOS License: GPL
#  
#       This software is free.  See the file ZeptoOS/misc/license.GPL
#       for complete details on your rights to copy, modify, and use this
#       software.
# ZEPTOOS:zepto-gpl
#***************************************************************************

. /etc/rc.status
. /etc/rc.dist

FTB_AGENT_LOCATION=$BGL_SITEDISTDIR/sbin/ftb_agent
FTB_ION_FLAG=ION_AGENT

if ! uname -r | grep -q ZeptoOS ; then
	echo "Not a ZeptoOS kernel, bailing out!"
	return=$rc_failed
	rc_exit
fi

rc_reset
case "$1" in
    start)
	echo "Starting FTB Agent... " >> /bgl/home1/rgupta/ftb_bgl/init.output
        echo "startproc -f $FTB_AGENT_LOCATION -p $FTB_ION_FLAG" >> /bgl/home1/rgupta/ftb_bgl/init.output
	startproc -f $FTB_AGENT_LOCATION -p "$FTB_ION_FLAG" >>/bgl/home1/rgupta/ftb_bgl/init.output 2>&1
	echo "done"
	;;
    stop)
        echo "Shutting FTB Agent ... " >> /bgl/home1/rgupta/ftb_bgl/init.output
        echo "killproc $FTB_AGENT_LOCATION" >> /bgl/home1/rgupta/ftb_bgl/init.output
        killproc $FTB_AGENT_LOCATION >>/bgl/home1/rgupta/ftb_bgl/init.output 2>&1
	rc_status -v
	echo "done"
	;;
esac
rc_exit
