Commit deab9983 authored by Russ Fish's avatar Russ Fish

Add tbshutdown for Windows.

parent 6b8767f1
......@@ -94,6 +94,7 @@ script-install: dir-install $(SCRIPTS)
$(INSTALL) -m 755 $(SRCDIR)/startsshd $(BINDIR)/startsshd
$(INSTALL) -m 755 $(SRCDIR)/stopsshd $(BINDIR)/stopsshd
$(INSTALL) -m 755 $(SRCDIR)/prepare $(BINDIR)/prepare
$(INSTALL) -m 755 $(SRCDIR)/tbshutdown $(BINDIR)/tbshutdown
$(INSTALL) -c -m 755 -o root -g wheel -d /sbin
$(INSTALL) -m 755 $(SRCDIR)/reboot /sbin/reboot
ln -f -s /bin/shutdown /sbin/shutdown
......
......@@ -70,3 +70,6 @@ netsh interface reset all
ipconfig /all | awk \
'/^ *Connection-specific DNS Suffix/{print "search", $NF} \
/^ *DNS Servers/{print "nameserver", $NF}' > /etc/resolv.conf
# Start up the service which will deliver a SHUTDOWN state event on reboot.
cygrunsrv -S EmulabShutdown
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2003 University of Utah and the Flux Group.
# All rights reserved.
#
use English;
#
# tbshutdown
#
# A simple daemon that is started automatically as a CygWin service
# with the --termsig option, so it gets killed with SIGTERM on reboot.
# When it gets killed, it sends a notification to the testbed.
#
# Drag in path stuff so we can find emulab stuff.
BEGIN { require "/etc/emulab/paths.pm"; import emulabpaths; }
use libtmcc;
# Set up some signal handlers
$SIG{INT} = \&cleanup;
$SIG{QUIT} = \&cleanup;
$SIG{ABRT} = \&cleanup;
$SIG{TERM} = \&cleanup;
$SIG{KILL} = \&cleanup;
# Then fall asleep until we're sent a signal
sleep;
exit(0);
sub cleanup {
# This is our signal handler.
tmcc(TMCCCMD_STATE, "SHUTDOWN");
exit(0);
}
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