Commit 4ce998a8 authored by Mike Hibler's avatar Mike Hibler
Browse files

Assorted dink-age to get things working under FreeBSD.

parent 9c5d3308
......@@ -165,15 +165,21 @@ if {$do_bsd} {
set elab_rpms "/proj/tbres/auto-pelab/libpcap-0.8.3-3.i386.rpm /proj/tbres/auto-pelab/iperf-2.0.2-1.1.fc2.rf.i386.rpm"
}
if {$do_bsd} {
set elabshell "/bin/sh -T"
} else {
set elabshell "/bin/sh"
}
if {$use_magent} {
set stubcommand "/bin/sh /local/pelab/magent/auto-magent.sh"
} else {
set stubcommand "/bin/sh /local/pelab/stub/auto-stub.sh"
}
if {$use_dbmonitor} {
set moncommand "/bin/sh /local/pelab/dbmonitor/auto-dbmonitor.sh"
set moncommand "$elabshell /local/pelab/dbmonitor/auto-dbmonitor.sh"
} else {
set moncommand "/bin/sh /local/pelab/monitor/auto-monitor.sh"
set moncommand "$elabshell /local/pelab/monitor/auto-monitor.sh"
}
set elan_string ""
......@@ -263,7 +269,7 @@ for {set i 1} {$i <= $num_pcs} {incr i} {
incr tfix
if {$trace_end_nodes} {
set tcpdump($tdix) [$elab($i) program-agent -command "/bin/sh /local/pelab/run-tcpdump.sh elab $i $tcpdump_args"]
set tcpdump($tdix) [$elab($i) program-agent -command "$elabshell /local/pelab/run-tcpdump.sh elab $i $tcpdump_args"]
lappend tdlist $tcpdump($tdix)
incr tdix
}
......
......@@ -36,7 +36,7 @@ NICKFILE="$EMUBOOT/nickname"
RCPLAB="$EMUBOOT/rc.plab"
HOSTSFILE="/etc/hosts"
IFCONFIG="/sbin/ifconfig"
PERL="${BIN_PATH}/perl"
PERL="/usr/bin/perl"
PYTHON="${BIN_PATH}/python"
SH=/bin/sh
SUDO="${BIN_PATH}/sudo"
......@@ -220,6 +220,16 @@ log_output_background()
echo $!
}
sync_watchdog()
{
TIMO=$1
SYNCDPID=$2
sleep $TIMO
echo '*** HUPing syncd'
$AS_ROOT kill -HUP $SYNCDPID
}
#
# If $SYNC command doesn't return within the indicated timeout period,
# HUP the syncserver to force everyone out of a barrier.
......@@ -241,7 +251,7 @@ sync_timeout()
# and a watchdog
if [ -n "$SYNCDPID" ]; then
(sleep $TIMO; echo '*** HUPing syncd'; $AS_ROOT kill -HUP $SYNCDPID) & DOGPID=$!
sync_watchdog $TIMO $SYNCDPID & DOGPID=$!
fi
# wait for the command to finish or be terminated
......@@ -250,7 +260,7 @@ sync_timeout()
# nuke the watchdog
if [ -n "$SYNCDPID" ]; then
kill $DOGPID >/dev/null 2>&1
kill -9 $DOGPID >/dev/null 2>&1
fi
# and return the result
......
#!/bin/sh
#
# XXX under BSD this script has to be run with -T or else a signal will
# not break the script out of the wait.
#
ARGS=$*
if [ -z "$PID" -o -z "$EID" ]; then
......@@ -29,7 +33,7 @@ echo $SH ${DBMONITOR_DIR}/run-dbmonitor.sh $ARGS
$SH ${DBMONITOR_DIR}/run-dbmonitor.sh $ARGS &
DBMONPID=$!
# Kill the monitor if we get killed - TODO: harsher kill?
trap "$AS_ROOT kill $DBMONPID" EXIT
trap "$AS_ROOT kill $DBMONPID" TERM
#
# Give it time to come up
......@@ -50,4 +54,5 @@ echo "Running!";
#
# Wait for our monitor to finish
#
wait
wait $DBMONPID
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