Commit e12934a2 authored by Mike Hibler's avatar Mike Hibler

MFS fixups.

Make sure we clear out any partial GPTs. On FreeBSD we just use
"gpart destroy" which will get rid of an MBR or GPT.

Tee the output of rc.frisbee into a file and upload that back to
boss in the event of a failure. We will see if this proves useful.
parent 7a76cc98
#!/bin/sh
#
# Copyright (c) 2000-2014 University of Utah and the Flux Group.
# Copyright (c) 2000-2015 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -560,8 +560,12 @@ case $STATUS in
#[ $d = $DISK ] && continue
mount | grep "^/dev/$d" > /dev/null && continue
zapsuperblocks $d
echo "Invalidating MBR on $d"
dd if=/dev/zero of=/dev/$d bs=512 count=16
echo "Invalidating MBR/GPT on $d"
if [ -x /sbin/gpart ]; then
gpart destroy -F $d
else
dd if=/dev/zero of=/dev/$d bs=512 count=16
fi
done
#
......
#
# Copyright (c) 2000-2013 University of Utah and the Flux Group.
# Copyright (c) 2000-2015 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -147,6 +147,7 @@ frisbee-mfs-install: destdircheck
ln -s /etc/dhclient-exit-hooks $(DESTDIR)/usr/local/etc/
rmdir $(DESTDIR)/usr/local/etc/emulab
$(INSTALL) -m 644 $(SRCDIR)/mfs-frisbee-rc.conf $(SYSETCDIR)/rc.conf
$(INSTALL) -m 644 $(SRCDIR)/mfs-frisbee-rc.local $(SYSETCDIR)/rc.local
$(INSTALL) -m 555 ./netif-emulab $(SYSETCDIR)/rc.d/netif-emulab
@if [ -r $(SRCDIR)/master.passwd ]; then \
$(INSTALL) -m 600 $(SRCDIR)/master.passwd $(SYSETCDIR); \
......
#!/bin/sh
if [ -r /etc/emulab/paths.sh ]; then
. /etc/emulab/paths.sh
else
BINDIR=/etc/testbed
BOOTDIR=/etc/testbed
ETCDIR=/etc/testbed
fi
#
# Note: we try to feed the output of rc.frisbee back to boss via tmcc.
# But we only do this if frisbee fails since we don't get back here on
# success (rc.frisbee waits to be rebooted).
#
stat=0
if [ -x "$BINDIR/rc.frisbee" ]; then
echo "Playing Frisbee ..."
if [ -x /usr/bin/tee ]; then
($BINDIR/rc.frisbee || echo $? >/tmp/stat) 2>&1 | tee /tmp/frisbee.log
stat=$?
if [ -e /tmp/stat ]; then
stat=`cat /tmp/stat`
fi
else
$BINDIR/rc.frisbee
stat=$?
fi
if [ $stat -ne 0 ]; then
if [ -x "$BINDIR/tmcc" -a -e /tmp/frisbee.log ]; then
$BINDIR/tmcc -f /tmp/frisbee.log bootlog
fi
echo "rc.frisbee failed ($stat)"
fi
else
echo "$BINDIR/rc.frisbee does not exist!"
stat=1
fi
exit $stat
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