Commit cfaf7c70 authored by Ryan Jackson's avatar Ryan Jackson

Changes to make Emulab play nicely with systemd

In some cases systemd doesn't like our behavior of starting emulab services
from rc.local and killing them from the testbed service.  There's really no
reason to be doing it this way under systemd anyway, so make the testbed
service do both.
parent 413b6954
......@@ -77,6 +77,8 @@ etc-install: dir-install sysetc-remove sysetc-install
$(INSTALL) -m 644 $(SRCDIR)/passwd $(ETCDIR)/passwd
$(INSTALL) -m 600 $(SRCDIR)/shadow $(ETCDIR)/shadow
$(INSTALL) -m 600 $(SRCDIR)/gshadow $(ETCDIR)/gshadow
$(INSTALL) -m 755 $(SRCDIR)/rc.local $(ETCDIR)/rc.d/rc.local
$(INSTALL) -m 755 $(SRCDIR)/testbed $(ETCDIR)/rc.d/init.d/testbed
@echo "fedora-specific etc-install done"
sysetc-install: ifcfgs dir-install
......
#!/bin/sh
#
# EMULAB-COPYRIGHT
# Copyright (c) 2004 University of Utah and the Flux Group.
# All rights reserved.
#
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
echo "Boot Complete"
#!/bin/bash
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2007 University of Utah and the Flux Group.
# All rights reserved.
#
. /etc/emulab/paths.sh
#
# testbed Do some testbed stuff,
#
# description: On shutdown, it informs the testbed we are rebooting
# and terminates any lingering daemons.
# Source function library.
if [ -f /etc/rc.d/init.d/functions ]; then
. /etc/rc.d/init.d/functions
fi
# Source networking configuration.
if [ -f /etc/sysconfig/network ]; then
. /etc/sysconfig/network
elif [ -f /lib/lsb/init-functions ]; then
. /lib/lsb/init-functions
NETWORKING=yes
fi
# Check that networking is up.
[ "${NETWORKING}" = "no" ] && exit 0
RETVAL=0
# See how we were called.
case "$1" in
start)
#
# Testbed Setup.
#
if [ -f /usr/local/etc/emulab/rc/rc.testbed ] ; then
echo -n 'testbed config: '
/usr/local/etc/emulab/rc/rc.testbed
touch /var/lock/subsys/testbed
fi
;;
stop)
rm -f /var/lock/subsys/testbed /var/emulab/boot/controlif
echo "Shutting down testbed daemons (some may fail)..."
echo -n " trafgen: "
killproc trafgen
echo
echo -n " program-agent: "
killproc program-agent
echo
echo -n " slothd: "
killproc slothd
echo
echo -n " healthd: "
killproc healthd
echo
echo -n " watchdog: "
killproc watchdog
echo
echo -n " evproxy: "
killproc evproxy
echo
echo -n " linktest: "
killproc linktest
echo
echo -n " emulab-syncd: "
killproc emulab-syncd
echo
echo -n " tippty: "
killproc tippty
echo
if [ ! -f /var/lock/subsys/tbprepare ]; then
echo "Informing the testbed we're rebooting ..."
$BINDIR/tmcc state SHUTDOWN
RETVAL=$?
fi
;;
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