Commit 2ec3c339 authored by Srikanth Raju's avatar Srikanth Raju Committed by Leigh Stoller

Start meta server along with tmcd..ish

Probably wildly wrong
parent 5abc2b82
......@@ -196,7 +196,19 @@ if __name__ == '__main__':
from BaseHTTPServer import HTTPServer
import socket
server = HTTPServer((socket.gethostbyname(socket.gethostname()), 8787), Ec2MetaHandler)
pid = str(os.getpid())
pidfile = "/var/run/tmcd-meta.pid"
if os.path.isfile(pidfile):
print "%s already exists, exiting" % pidfile
sys.exit()
else:
file(pidfile, 'w').write(pid)
print 'Starting server, use <Ctrl-C> to stop'
server.serve_forever()
os.unlink(pidfile)
......@@ -30,7 +30,7 @@ SYSTEM := $(shell $(TESTBED_SRCDIR)/utils/osstuff.sh -o)
include $(OBJDIR)/Makeconf
all: server
server: tmcd tmcd.restart
server: tmcd-meta tmcd tmcd.restart
# For VPATH.
MOSTLY_SRCDIRS = ${TESTBED_LIBSRCDIR}/libtb ${TESTBED_SRCDIR}/pxe \
......@@ -77,6 +77,9 @@ ifeq ($(EVENTSYS),1)
ELVINFLAGS = -lm -L/usr/local/lib -lpubsub
endif
tmcd-meta:
easy_install mysql-connector
tmcd: tmcd.c ${TMCDLIBS} tmcd.h version.o $(BOOTINFO) $(NOTPMLIB)
$(CC) $(CFLAGS) $(SSLFLAGS) $(TMCDCFLAGS) -o tmcd $< \
version.o $(NOTPMLIB) $(BOOTINFO) \
......
......@@ -30,6 +30,14 @@ then
rm -f /var/run/tmcd.pid
fi
if [ -f /var/run/tmcd-meta.pid ]
then
kill `cat /var/run/tmcd-meta.pid` >/dev/null 2>&1
rm -f /var/run/tmcd-meta.pid
fi
sleep 1
${DIR}/Ec2MetaServer.py
${DIR}/tmcd -i @BOSSNODE_IP@
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