Commit 0e007341 authored by Leigh Stoller's avatar Leigh Stoller

Add old style upstart/rc.d files for older control nodes.

parent e245ee58
......@@ -26,6 +26,8 @@ OBJDIR = @top_builddir@
SUBDIR = $(subst $(TESTBED_SRCDIR)/,,$(SRCDIR))
SYSTEM := $(shell uname -s)
LN_S = /bin/ln -s
MKDIR_P = /bin/mkdir -p
include $(OBJDIR)/Makeconf
......@@ -116,15 +118,35 @@ rack-control-install: rack-control
$(INSTALL_PROGRAM) capture-nossl$(EXE) $(DESTDIR)$(INSTALL_SBINDIR)/capture-nossl$(EXE)
rack-control-startup-install: rack-control-install
if [ -d "/etc/systemd/system" ]; then \
if [ -x "/bin/systemctl" ]; then \
$(MKDIR_P) /etc/systemd/system ; \
$(INSTALL_PROGRAM) $(SRCDIR)/capture-boss.service /etc/systemd/system ; \
$(INSTALL_PROGRAM) $(SRCDIR)/capture-ops.service /etc/systemd/system ; \
$(MKDIR_P) /etc/systemd/system/multi-user.target.wants ; \
ln -sf ../capture-boss.service \
$(LN_S) ../capture-boss.service \
/etc/systemd/system/multi-user.target.wants/capture-boss.service ; \
ln -sf ../capture-ops.service \
$(LN_S) ../capture-ops.service \
/etc/systemd/system/multi-user.target.wants/capture-ops.service ; \
else \
$(MKDIR_P) /etc/init.d ; \
$(INSTALL_PROGRAM) $(SRCDIR)/linux-capture-boss.sh /etc/init.d/capture-boss ; \
$(INSTALL_PROGRAM) $(SRCDIR)/linux-capture-ops.sh /etc/init.d/capture-ops ; \
$(MKDIR_P) /etc/rc2.d ; \
(cd /etc/rc2.d && \
$(LN_S) -f ../init.d/capture-boss S95capture-boss && \
$(LN_S) -f ../init.d/capture-ops S95capture-ops) ; \
$(MKDIR_P) /etc/rc3.d ; \
(cd /etc/rc3.d && \
$(LN_S) -f ../init.d/capture-boss S95capture-boss && \
$(LN_S) -f ../init.d/capture-ops S95capture-ops) ; \
$(MKDIR_P) /etc/rc1.d ; \
(cd /etc/rc1.d && \
$(LN_S) -f ../init.d/capture-boss K13capture-boss && \
$(LN_S) -f ../init.d/capture-ops K13capture-ops) ; \
$(MKDIR_P) /etc/rc6.d ; \
(cd /etc/rc6.d && \
$(LN_S) -f ../init.d/capture-boss K13capture-boss && \
$(LN_S) -f ../init.d/capture-ops K13capture-ops) ; \
fi
clean:
......
#!/bin/sh
#
# capture-boss Start and stop capture for boss VM
#
### BEGIN INIT INFO
# Provides: capture-boss
# Default-Start: 3 4 5
# Default-Stop: 0 1 6
# Should-Start:
# Required-Start: $network
# Required-Stop:
# Short-Description: Start and stop capture for boss VM
# Description: Start and stop capture for boss VM
### END INIT INFO
#
# The fields below are left around for legacy tools (will remove later).
#
# chkconfig: 345 89 11
# description: Start and stop capture for boss VM
#
# EMULAB-COPYRIGHT
# Copyright (c) 2007-2018 University of Utah and the Flux Group.
# All rights reserved.
#
# 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
#
# XXX Ubuntu/debian hackery for now
#
NETWORKING=yes
if [ ! -d /var/lock/subsys ]; then
mkdir /var/lock/subsys
fi
echo_success() {
log_end_msg 0
}
echo_failure() {
log_end_msg $?
}
fi
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
RETVAL=1
ARGS="-I -i -C -L -T 10 -R 2000 -l /var/log/tiplogs"
case "$1" in
start)
if [ -x /usr/local/sbin/capture-nossl ]; then
echo -n "Starting capture-boss: "
/usr/local/sbin/capture-nossl $ARGS -X boss boss
RETVAL=$?
[ "$?" -eq 0 ] && echo_success || echo_failure
echo
fi
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/capture-boss
;;
stop)
echo -n "Shutting down capture-boss: "
killproc -p /var/log/tiplogs/boss.pid
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/capture-boss
;;
*)
echo "Usage: `basename $0` {start|stop}" >&2
;;
esac
exit $RETVAL
#!/bin/sh
#
# capture-ops Start and stop capture for ops VM
#
### BEGIN INIT INFO
# Provides: capture-ops
# Default-Start: 3 4 5
# Default-Stop: 0 1 6
# Should-Start:
# Required-Start: $network
# Required-Stop:
# Short-Description: Start and stop capture for ops VM
# Description: Start and stop capture for ops VM
### END INIT INFO
#
# The fields below are left around for legacy tools (will remove later).
#
# chkconfig: 345 89 11
# description: Start and stop capture for ops VM
#
# EMULAB-COPYRIGHT
# Copyright (c) 2007-2018 University of Utah and the Flux Group.
# All rights reserved.
#
# 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
#
# XXX Ubuntu/debian hackery for now
#
NETWORKING=yes
if [ ! -d /var/lock/subsys ]; then
mkdir /var/lock/subsys
fi
echo_success() {
log_end_msg 0
}
echo_failure() {
log_end_msg $?
}
fi
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
RETVAL=1
ARGS="-I -i -C -L -T 10 -R 2000 -l /var/log/tiplogs"
case "$1" in
start)
if [ -x /usr/local/sbin/capture-nossl ]; then
echo -n "Starting capture-ops: "
/usr/local/sbin/capture-nossl $ARGS -X ops ops
RETVAL=$?
[ "$?" -eq 0 ] && echo_success || echo_failure
echo
fi
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/capture-ops
;;
stop)
echo -n "Shutting down capture-ops: "
killproc -p /var/log/tiplogs/ops.pid
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/capture-ops
;;
*)
echo "Usage: `basename $0` {start|stop}" >&2
;;
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