4.igforwarder.sh.in 1.01 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#!/bin/sh
#
# Start up the event forward to send Geni style events to the Portal.
#

# PROVIDE: igclusterd
# REQUIRE: testbed
# KEYWORD: shutdown

TBROOT="@prefix@"
MAINSITE="@TBMAINSITE@"
PROTOGENI="@PROTOGENI_SUPPORT@"
CLUSTER_PORTAL="@CLUSTER_PORTAL@"

if [ $PROTOGENI == "0" ]; then
    exit 0
fi
if [ $CLUSTER_PORTAL == "" ]; then
    exit 0
fi

22
wrapper=$TBROOT/sbin/daemon_wrapper
23
forwarder=/usr/local/libexec/pubsub_forward
24
pidfile=/var/run/pubsub_forward_wrapper.pid
25 26 27
certfile=$TBROOT/etc/emulab.pem
keyfile=$TBROOT/etc/emulab.key
remoteport=@CLUSTER_PUBSUBD_PORT@
Leigh Stoller's avatar
Leigh Stoller committed
28
args="-s $CLUSTER_PORTAL -p $remoteport -K $keyfile -C $certfile -S"
29 30 31 32

case "$1" in
    start|faststart|quietstart|onestart|forcestart)
	if [ -x $forwarder ]; then
33 34
	    $wrapper -n pubsub_forward $forwarder -f $args
	    echo -n " igforwarder wrapper";
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
	fi
	;;
    stop|faststop|quietstop|onestop|forcestop)
	if [ -r $pidfile ]; then
	    kill `cat $pidfile`
	fi
	;;
    *)
	echo ""
	echo "Usage: `basename $0` { start | stop }"
	echo ""
	exit 64
	;;
esac
exit 0