Commit 161e71b4 authored by Mike Hibler's avatar Mike Hibler

Add tipserv startup script for captures.

Not ideal, there is a startup script which in turn invokes a run_capture
script.  The latter contains the actual capture lines.  The idea is that
the latter could be auto-generated someday from info passed via tmcd.  But
at the moment, it is manually maintained.
parent 8cd5fcc3
......@@ -2673,7 +2673,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
vis/floormap vis/webfloormap \
rc.d/GNUmakefile rc.d/2.mysql-server.sh rc.d/3.testbed.sh \
rc.d/2.elvind.sh rc.d/3.plab.sh rc.d/2.dhcpd.sh rc.d/3.and.sh \
rc.d/3.elvin_gateway.sh rc.d/pelab.sh \
rc.d/3.elvin_gateway.sh rc.d/pelab.sh rc.d/capture.sh \
tools/GNUmakefile rc.d/1.mysql-server.sh tools/svn/GNUmakefile \
tools/pcapper/GNUmakefile tools/teachswitch/GNUmakefile \
tools/webcamapplet/GNUmakefile tools/whol/GNUmakefile \
......
......@@ -953,7 +953,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
vis/floormap vis/webfloormap \
rc.d/GNUmakefile rc.d/2.mysql-server.sh rc.d/3.testbed.sh \
rc.d/2.elvind.sh rc.d/3.plab.sh rc.d/2.dhcpd.sh rc.d/3.and.sh \
rc.d/3.elvin_gateway.sh rc.d/pelab.sh \
rc.d/3.elvin_gateway.sh rc.d/pelab.sh rc.d/capture.sh \
tools/GNUmakefile rc.d/1.mysql-server.sh tools/svn/GNUmakefile \
tools/pcapper/GNUmakefile tools/teachswitch/GNUmakefile \
tools/webcamapplet/GNUmakefile tools/whol/GNUmakefile \
......
......@@ -23,6 +23,7 @@ OPS_SCRIPTS = 3.and.sh 1.mysql-client.sh 1.mysql-server.sh
ifeq ($(ELVINCOMPAT),1)
OPS_SCRIPTS += 2.elvind.sh 3.elvin_gateway.sh
endif
TIP_SCRIPTS =
ifeq ($(SYSTEM),FreeBSD)
FBSDVERSION := $(shell uname -v | sed -e 's/FreeBSD \([0-9]\).*/FreeBSD\1/')
......@@ -31,8 +32,11 @@ ifeq ($(FBSDVERSION),FreeBSD6)
ifeq ($(WINSUPPORT),1)
OPS_SCRIPTS += silly.sh
endif
# install without .sh
TIP_SCRIPTS += capture
else
RC_SCRIPTS += 1.named.sh
TIP_SCRIPTS += capture.sh
endif
endif
ifeq ($(PELABSUPPORT),1)
......@@ -43,7 +47,7 @@ endif
# Force dependencies to make sure configure regenerates if the .in file
# is changed.
#
all: $(RC_SCRIPTS) $(OPS_SCRIPTS)
all: $(RC_SCRIPTS) $(OPS_SCRIPTS) capture.sh
include $(TESTBED_SRCDIR)/GNUmakerules
......@@ -53,6 +57,11 @@ $(INSTALL_RCDIR)/%: %
-mkdir -p $(INSTALL_RCDIR)
$(INSTALL_PROGRAM) $< $@
# special case for capture.sh -> capture
$(INSTALL_RCDIR)/capture: capture.sh
@echo "Installing $<"
-mkdir -p $(INSTALL_RCDIR)
$(INSTALL_PROGRAM) capture.sh $@
install: $(addprefix $(INSTALL_RCDIR)/, $(RC_SCRIPTS))
......@@ -61,3 +70,4 @@ control-install: $(addprefix $(INSTALL_RCDIR)/, $(OPS_SCRIPTS))
clrhouse-install: $(INSTALL_RCDIR)/2.mysql-server.sh \
$(INSTALL_RCDIR)/1.mysql-client.sh
tipserv-install: $(addprefix $(INSTALL_RCDIR)/, $(TIP_SCRIPTS))
#!/bin/sh
# PROVIDE: capture
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: shutdown
#
# Start up capture processes.
#
# XXX if you notice that each capture is being started up twice on reboot.
# then you need to make sure that the "local_startup" path in /etc/rc.conf
# (or /etc/defaults/rc.conf) does not include /usr/X11R6/etc/rc.d.
# In FreeBSD 6 and above, /usr/X11R6 is a symlink to /usr/local and the
# result is that scripts in /usr/local/etc/rc.d wind up being called twice.
# This is okay for scripts that fully use the FreeBSD rc system, but since
# this script is "not quite conforming" it causes captures to be started
# twice. You may need to override local_startup in /etc/rc.conf to avoid this.
#
. /etc/rc.subr
bindir=@prefix@/sbin
if [ ! -x $bindir/capture ]; then
echo "*** capture.sh: $bindir/capture not installed"
exit 1
fi
case "$1" in
start|faststart)
;;
restart)
killall capture
;;
stop)
killall capture && echo -n ' capture'
exit 0
;;
*)
echo "Usage: $0 {start|stop|restart}" >&2
exit 1
;;
esac
#
# run_capture contains the actual capture start lines that look like:
#
# $bindir/capture -T 15 -r -s [baudrate] [device] [ttyport] >/dev/null 2>&1 &
#
# The -T option gives the idle timestamp interval; i.e., if output on the
# device occurs, and it has been more than <interval> seconds since the last
# output, a timestamp is output to the log before the current output.
# This helps identify long gaps between output in the logfile and effectively
# time stamps "blocks" of output in the log.
#
# You should put a "sleep 1" in after every 1-20 lines to avoid overload
# (since these are all background startups).
#
# XXX run_capture should be auto-generated.
#
if [ -x $bindir/run_capture ]; then
$bindir/run_capture $bindir/capture
fi
exit $?
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