Commit efe27f09 authored by Robert Ricci's avatar Robert Ricci

Support for informing the testbed of the node rebooting. Implemented

as a script in init.d that gets called when the node goes into
runlevel 6 (reboot.)

(Note, it has to get 'started' earlier, when going into runlevel 3,
because if it has not created a lockfile in /var/lock/subsys,
it will not get called when shutting down.)
parent f4a25d22
......@@ -70,3 +70,6 @@ script-install: dir-install
$(INSTALL) -m 644 $(SRCDIR)/gated_eth2.conf $(INSTALL_DIR)/gated_eth2.conf
$(INSTALL) -m 644 $(SRCDIR)/gated_eth4.conf $(INSTALL_DIR)/gated_eth4.conf
$(INSTALL) -m 755 $(SRCDIR)/S12testbed /etc/rc.d/rc3.d/S12testbed
$(INSTALL) -m 755 $(SRCDIR)/tbshutdown /etc/rc.d/init.d/
-ln -s /etc/rc.d/init.d/tbshutdown /etc/rc.d/rc3.d/S13tbshutdown
-ln -s /etc/rc.d/init.d/tbshutdown /etc/rc.d/rc6.d/K13tbshutdown
#!/bin/bash
#
# testbed-shutdown - On shutdown, inform the testbed that we're going down
#
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
if [ ! -f /etc/sysconfig/network ]; then
exit 0
fi
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
RETVAL=0
# See how we were called.
case "$1" in
start)
touch /var/lock/subsys/tbshutdown
echo "Done"
;;
stop)
rm /var/lock/subsys/tbshutdown
echo "Informing the testbed we're rebooting ..."
/etc/rc.d/testbed/tmcc state REBOOTING
RETVAL=$?
;;
status)
echo "Peachy"
;;
restart)
echo "Done"
;;
reload)
echo "Done"
;;
*)
echo "Usage: testbed {start|stop|restart|reload|status}"
exit 1
esac
exit $RETVAL
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment