Commit 95b370f5 authored by Mike Hibler's avatar Mike Hibler

Cleanup the source tree to account for master frisbee server.

No more frisbeelauncher or assorted subboss frisbee stuff.
parent 3a1ae260
#!/usr/bin/perl -wT #!/usr/bin/perl -wT
# #
# EMULAB-COPYRIGHT # EMULAB-COPYRIGHT
# Copyright (c) 2000-2007 University of Utah and the Flux Group. # Copyright (c) 2000-2011 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
use English; use English;
...@@ -139,8 +139,6 @@ my %xmlfields = ...@@ -139,8 +139,6 @@ my %xmlfields =
"description" => ["description", $SLOT_OPTIONAL], "description" => ["description", $SLOT_OPTIONAL],
"path" => ["path", $SLOT_OPTIONAL], "path" => ["path", $SLOT_OPTIONAL],
"mtype_*" => ["mtype", $SLOT_OPTIONAL], "mtype_*" => ["mtype", $SLOT_OPTIONAL],
#"load_address" => ["load_address", $SLOT_ADMINONLY],
#"frisbee_pid" => ["frisbee_pid", $SLOT_ADMINONLY]
); );
# #
# Need a list of node types. We join this over the nodes table so that # Need a list of node types. We join this over the nodes table so that
...@@ -375,31 +373,6 @@ foreach $key (@mtype_keys) { ...@@ -375,31 +373,6 @@ foreach $key (@mtype_keys) {
UserError("Node Types: Must select at least one node type") UserError("Node Types: Must select at least one node type")
if ($node_types_selected == 0); if ($node_types_selected == 0);
#
# Only admins can edit the load_address or the frisbee pid.
# XXX: Bring back functionally is some way
#if ($isadmin) {
# if (exists($editimageid_args{"load_address"}) &&
# $editimageid_args{"load_address"} ne "") {
# $foo = escapeshellarg($editimageid_args{"load_address"});
#
# if ($editimageid_args{"load_address"} ne $foo) {
# UserError("Load Address: Contains illegal characters!");
# }
# }
# # Frisbee_pid has already been checked to be a valid int coming from XML.
#}
#else { # Not isadmin.
# if (exists($editimageid_args{"load_address"}) &&
# $editimageid_args{"load_address"} ne $image->load_address()) {
# UserError("Load Address: No permission, admin-only");
# }
# if (exists($editimageid_args{"frisbee_pid"}) &&
# $editimageid_args{"frisbee_pid"} ne $image->frisbee_pid()) {
# UserError("Frisbee PID: No permission, admin-only");
# }
#}
# #
# Mereusers are not allowed to create more than one osid/imageid mapping # Mereusers are not allowed to create more than one osid/imageid mapping
# for each machinetype. They cannot actually do that through the EZ form # for each machinetype. They cannot actually do that through the EZ form
......
...@@ -2230,17 +2230,17 @@ for ac_hdr in ulxmlrpcpp/ulxr_config.h ...@@ -2230,17 +2230,17 @@ for ac_hdr in ulxmlrpcpp/ulxr_config.h
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2226: checking for $ac_hdr" >&5 echo "configure:2234: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2231 "configure" #line 2239 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2236: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:2244: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -2279,17 +2279,17 @@ for ac_hdr in linux/videodev.h ...@@ -2279,17 +2279,17 @@ for ac_hdr in linux/videodev.h
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2275: checking for $ac_hdr" >&5 echo "configure:2283: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2280 "configure" #line 2288 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2285: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:2293: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -2322,7 +2322,7 @@ done ...@@ -2322,7 +2322,7 @@ done
# Extract the first word of "gtk-config", so it can be a program name with args. # Extract the first word of "gtk-config", so it can be a program name with args.
set dummy gtk-config; ac_word=$2 set dummy gtk-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2318: checking for $ac_word" >&5 echo "configure:2326: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_GTK_CONFIG'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_prog_GTK_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
...@@ -2379,7 +2379,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes ...@@ -2379,7 +2379,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes
cross_compiling=$ac_cv_prog_cxx_cross cross_compiling=$ac_cv_prog_cxx_cross
echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6 echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6
echo "configure:2375: checking how to run the C++ preprocessor" >&5 echo "configure:2383: checking how to run the C++ preprocessor" >&5
if test -z "$CXXCPP"; then if test -z "$CXXCPP"; then
if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
...@@ -2392,12 +2392,12 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes ...@@ -2392,12 +2392,12 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes
cross_compiling=$ac_cv_prog_cxx_cross cross_compiling=$ac_cv_prog_cxx_cross
CXXCPP="${CXX-g++} -E" CXXCPP="${CXX-g++} -E"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2388 "configure" #line 2396 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <stdlib.h> #include <stdlib.h>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2393: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:2401: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
: :
...@@ -2423,17 +2423,17 @@ echo "$ac_t""$CXXCPP" 1>&6 ...@@ -2423,17 +2423,17 @@ echo "$ac_t""$CXXCPP" 1>&6
ac_safe=`echo "xercesc/dom/DOM.hpp" | sed 'y%./+-%__p_%'` ac_safe=`echo "xercesc/dom/DOM.hpp" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for xercesc/dom/DOM.hpp""... $ac_c" 1>&6 echo $ac_n "checking for xercesc/dom/DOM.hpp""... $ac_c" 1>&6
echo "configure:2419: checking for xercesc/dom/DOM.hpp" >&5 echo "configure:2427: checking for xercesc/dom/DOM.hpp" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2424 "configure" #line 2432 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <xercesc/dom/DOM.hpp> #include <xercesc/dom/DOM.hpp>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2429: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:2437: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -2497,7 +2497,7 @@ fi ...@@ -2497,7 +2497,7 @@ fi
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh. # ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
echo "configure:2493: checking for a BSD compatible install" >&5 echo "configure:2501: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
...@@ -2558,7 +2558,7 @@ esac ...@@ -2558,7 +2558,7 @@ esac
# Extract the first word of "rsync", so it can be a program name with args. # Extract the first word of "rsync", so it can be a program name with args.
set dummy rsync; ac_word=$2 set dummy rsync; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2554: checking for $ac_word" >&5 echo "configure:2562: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_RSYNC'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_path_RSYNC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
...@@ -2681,8 +2681,7 @@ outfiles="$outfiles Makeconf GNUmakefile \ ...@@ -2681,8 +2681,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
tbsetup/batchexp tbsetup/batch_daemon tbsetup/repos_daemon \ tbsetup/batchexp tbsetup/batch_daemon tbsetup/repos_daemon \
tbsetup/wanlinkinfo tbsetup/wanassign \ tbsetup/wanlinkinfo tbsetup/wanassign \
tbsetup/swapexp tbsetup/endexp tbsetup/elabinelab \ tbsetup/swapexp tbsetup/endexp tbsetup/elabinelab \
tbsetup/frisbeelauncher tbsetup/eventsys.proxy tbsetup/frisbeeimage \ tbsetup/eventsys.proxy \
tbsetup/subboss_frisbeelauncher tbsetup/subboss_frisbeeimage \
tbsetup/snmpit.proxy tbsetup/snmpit_remote.pm \ tbsetup/snmpit.proxy tbsetup/snmpit_remote.pm \
tbsetup/snmpit tbsetup/ns2ir/GNUmakefile \ tbsetup/snmpit tbsetup/ns2ir/GNUmakefile \
tbsetup/ns2ir/parse.tcl tbsetup/ns2ir/tb_compat.tcl \ tbsetup/ns2ir/parse.tcl tbsetup/ns2ir/tb_compat.tcl \
...@@ -2697,7 +2696,7 @@ outfiles="$outfiles Makeconf GNUmakefile \ ...@@ -2697,7 +2696,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
tbsetup/tbreport tbsetup/named_setup tbsetup/exports_setup \ tbsetup/tbreport tbsetup/named_setup tbsetup/exports_setup \
tbsetup/checkpass/GNUmakefile tbsetup/assign_wrapper tbsetup/ptopgen \ tbsetup/checkpass/GNUmakefile tbsetup/assign_wrapper tbsetup/ptopgen \
tbsetup/assign_wrapper2 \ tbsetup/assign_wrapper2 \
tbsetup/frisbeelauncher tbsetup/node_update \ tbsetup/node_update \
tbsetup/savelogs tbsetup/setgroups \ tbsetup/savelogs tbsetup/setgroups \
tbsetup/savelogs.proxy tbsetup/rmgroup tbsetup/mkexpdir \ tbsetup/savelogs.proxy tbsetup/rmgroup tbsetup/mkexpdir \
tbsetup/node_control tbsetup/node_attributes \ tbsetup/node_control tbsetup/node_attributes \
......
...@@ -911,8 +911,7 @@ outfiles="$outfiles Makeconf GNUmakefile \ ...@@ -911,8 +911,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
tbsetup/batchexp tbsetup/batch_daemon tbsetup/repos_daemon \ tbsetup/batchexp tbsetup/batch_daemon tbsetup/repos_daemon \
tbsetup/wanlinkinfo tbsetup/wanassign \ tbsetup/wanlinkinfo tbsetup/wanassign \
tbsetup/swapexp tbsetup/endexp tbsetup/elabinelab \ tbsetup/swapexp tbsetup/endexp tbsetup/elabinelab \
tbsetup/frisbeelauncher tbsetup/eventsys.proxy tbsetup/frisbeeimage \ tbsetup/eventsys.proxy \
tbsetup/subboss_frisbeelauncher tbsetup/subboss_frisbeeimage \
tbsetup/snmpit.proxy tbsetup/snmpit_remote.pm \ tbsetup/snmpit.proxy tbsetup/snmpit_remote.pm \
tbsetup/snmpit tbsetup/ns2ir/GNUmakefile \ tbsetup/snmpit tbsetup/ns2ir/GNUmakefile \
tbsetup/ns2ir/parse.tcl tbsetup/ns2ir/tb_compat.tcl \ tbsetup/ns2ir/parse.tcl tbsetup/ns2ir/tb_compat.tcl \
...@@ -927,7 +926,7 @@ outfiles="$outfiles Makeconf GNUmakefile \ ...@@ -927,7 +926,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
tbsetup/tbreport tbsetup/named_setup tbsetup/exports_setup \ tbsetup/tbreport tbsetup/named_setup tbsetup/exports_setup \
tbsetup/checkpass/GNUmakefile tbsetup/assign_wrapper tbsetup/ptopgen \ tbsetup/checkpass/GNUmakefile tbsetup/assign_wrapper tbsetup/ptopgen \
tbsetup/assign_wrapper2 \ tbsetup/assign_wrapper2 \
tbsetup/frisbeelauncher tbsetup/node_update \ tbsetup/node_update \
tbsetup/savelogs tbsetup/setgroups \ tbsetup/savelogs tbsetup/setgroups \
tbsetup/savelogs.proxy tbsetup/rmgroup tbsetup/mkexpdir \ tbsetup/savelogs.proxy tbsetup/rmgroup tbsetup/mkexpdir \
tbsetup/node_control tbsetup/node_attributes \ tbsetup/node_control tbsetup/node_attributes \
......
#!/usr/bin/perl -wT #!/usr/bin/perl -wT
# #
# EMULAB-COPYRIGHT # EMULAB-COPYRIGHT
# Copyright (c) 2007-2010 University of Utah and the Flux Group. # Copyright (c) 2007-2011 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
package Image; package Image;
...@@ -127,9 +127,6 @@ sub part4_osid($) { return field($_[0], "part4_osid"); } ...@@ -127,9 +127,6 @@ sub part4_osid($) { return field($_[0], "part4_osid"); }
sub default_osid($) { return field($_[0], "default_osid"); } sub default_osid($) { return field($_[0], "default_osid"); }
sub path($) { return field($_[0], "path"); } sub path($) { return field($_[0], "path"); }
sub magic($) { return field($_[0], "magic"); } sub magic($) { return field($_[0], "magic"); }
#sub load_address($) { return field($_[0], "load_address"); }
#sub frisbee_pid($) { return field($_[0], "frisbee_pid"); }
#sub load_busy($) { return field($_[0], "load_busy"); }
sub ezid($) { return field($_[0], "ezid"); } sub ezid($) { return field($_[0], "ezid"); }
sub shared($) { return field($_[0], "shared"); } sub shared($) { return field($_[0], "shared"); }
sub global($) { return field($_[0], "global"); } sub global($) { return field($_[0], "global"); }
...@@ -139,6 +136,8 @@ sub access_key($) { return field($_[0], "access_key"); } ...@@ -139,6 +136,8 @@ sub access_key($) { return field($_[0], "access_key"); }
# #
# Get a list of all running frisbee images. # Get a list of all running frisbee images.
# XXX if this is actually used, it will have to be fixed; DB no longer
# tracks running frisbee daemons.
# #
sub ActiveImages($) sub ActiveImages($)
{ {
...@@ -370,7 +369,6 @@ sub EditImageid($$$$) ...@@ -370,7 +369,6 @@ sub EditImageid($$$$)
# (Others above already did their own updates.) # (Others above already did their own updates.)
# #
my %updates; my %updates;
#foreach my $col ("description", "path", "load_address", "frisbee_pid" ) {
foreach my $col ("description", "path") { foreach my $col ("description", "path") {
# Copy args we want so that others can't get through. # Copy args we want so that others can't get through.
if (exists($argref->{$col})) { if (exists($argref->{$col})) {
......
#!/usr/bin/perl -w #!/usr/bin/perl -w
# #
# EMULAB-COPYRIGHT # EMULAB-COPYRIGHT
# Copyright (c) 2010 University of Utah and the Flux Group. # Copyright (c) 2010-2011 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
use strict; use strict;
...@@ -49,8 +49,8 @@ my $PGENIUPDATE = "$TB/sbin/protogeni/update"; ...@@ -49,8 +49,8 @@ my $PGENIUPDATE = "$TB/sbin/protogeni/update";
my $PGENISUPPORT = @PROTOGENI_SUPPORT@; my $PGENISUPPORT = @PROTOGENI_SUPPORT@;
my $INSTALLUPDATE= "$TB/sbin/update-install"; my $INSTALLUPDATE= "$TB/sbin/update-install";
my $SETSITEVAR = "$TB/sbin/setsitevar"; my $SETSITEVAR = "$TB/sbin/setsitevar";
my $MFRISBEED = "/usr/local/etc/rc.d/3.mfrisbeed.sh";
my $STARTUP = "/usr/local/etc/rc.d/3.testbed.sh"; my $STARTUP = "/usr/local/etc/rc.d/3.testbed.sh";
my $FRISBEE = "$TB/sbin/frisbeelauncher";
my $tempfile = "/var/tmp/update.$$"; my $tempfile = "/var/tmp/update.$$";
# Protos # Protos
...@@ -225,8 +225,7 @@ sub Restart() ...@@ -225,8 +225,7 @@ sub Restart()
} }
if ($stopped) { if ($stopped) {
print "Starting up testbed daemons.\n"; print "Starting up testbed daemons.\n";
system("$STARTUP start"); if (system("$MFRISBEED start") || system("$STARTUP start")) {
if ($?) {
print "*** Could not restart testbed daemons.\n"; print "*** Could not restart testbed daemons.\n";
exit(1); exit(1);
} }
...@@ -307,47 +306,12 @@ if ($stopbed) { ...@@ -307,47 +306,12 @@ if ($stopbed) {
sleep(30); sleep(30);
} }
print "** Testbed is quiet; stopping testbed daemons ... \n"; print "** Testbed is quiet; stopping testbed daemons ... \n";
system("$STARTUP stop >/dev/null 2>&1"); if (system("$STARTUP stop >/dev/null 2>&1") ||
if ($?) { system("$MFRISBEED stop >/dev/null 2>&1")) {
Fatal("Could not stop testbed daemons. Stopping."); Fatal("Could not stop testbed daemons. Stopping.");
} }
$stopped = 1; $stopped = 1;
#
# XXX cannot just call Image->ActiveImages as the implementation
# changed and thus the code would not work when upgrading from a
# code base with the old implementation to one with the new.
#
my $table = "images";
if (!emdb::DBSlotExists("images", "frisbee_pid")) {
$table = "frisbee_blobs";
}
my $query_result =
emdb::DBQueryWarn("select imageid from $table where frisbee_pid!=0");
my @activeimages = ();
if ($query_result) {
while (my ($imageid) = $query_result->fetchrow_array()) {
my $image = Image->Lookup($imageid);
if (!defined($image)) {
print STDERR
"*** Could not find DB object for image $imageid\n";
next;
}
push(@activeimages, $image);
}
}
if (@activeimages > 0) {
print "** Stopping running frisbee processes ...\n";
foreach my $image (@activeimages) {
my $imageid = $image->imageid();
print "-> Killing frisbee for $image ...\n";
system("$FRISBEE -k $imageid");
if ($?) {
Fatal("Could not stop frisbee for $image!");
}
}
}
print "** Testbed is stopped. Proceeding to update\n"; print "** Testbed is stopped. Proceeding to update\n";
# #
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
* - record the state of running frisbeeds in persistant store so that * - record the state of running frisbeeds in persistant store so that
* they can be restarted if we die and restart * they can be restarted if we die and restart
* - related: make sure we don't leave orphans when we die! * - related: make sure we don't leave orphans when we die!
* - handle signals: INT/TERM should kill all frisbeeds and remove our pid
*/ */
#include <paths.h> #include <paths.h>
#include <sys/stat.h> #include <sys/stat.h>
...@@ -82,7 +83,7 @@ main(int argc, char **argv) ...@@ -82,7 +83,7 @@ main(int argc, char **argv)
MasterServerLogInit(); MasterServerLogInit();
log("mfrisbee daemon starting, methods=%s (debug level %d)", log("mfrisbeed daemon starting, methods=%s (debug level %d)",
GetMSMethods(onlymethods), debug); GetMSMethods(onlymethods), debug);
if (fetchfromabove) if (fetchfromabove)
log(" using parent %s:%d%s, methods=%s", log(" using parent %s:%d%s, methods=%s",
...@@ -113,7 +114,7 @@ main(int argc, char **argv) ...@@ -113,7 +114,7 @@ main(int argc, char **argv)
*/ */
if (!geteuid()) { if (!geteuid()) {
if (!pidfile) { if (!pidfile) {
sprintf(buf, "%s/mfrisbee.pid", _PATH_VARRUN); sprintf(buf, "%s/mfrisbeed.pid", _PATH_VARRUN);
pidfile = buf; pidfile = buf;
} }
fp = fopen(pidfile, "w"); fp = fopen(pidfile, "w");
......
#!/bin/sh
# PROVIDE: mfrisbeed
# REQUIRE: mysql
# BEFORE: testbed
# KEYWORD: shutdown
#
# Start up the frisbee master server.
# We run it under the daemon wrapper if available so that it will get
# automatically restarted.
#
. /etc/rc.subr
bindir=@prefix@/sbin
if [ ! -x $bindir/mfrisbeed ]; then
echo "*** mfrisbeed.sh: $bindir/mfrisbeed not installed"
exit 1
fi
case "$1" in
start|faststart)
;;
restart)
if [ -f /var/run/mfrisbeed_wrapper.pid ]; then
kill `cat /var/run/mfrisbeed_wrapper.pid` >/dev/null 2>&1
rm -f /var/run/mfrisbeed_wrapper.pid
fi
if [ -f /var/run/mfrisbeed.pid ]; then
kill `cat /var/run/mfrisbeed.pid` >/dev/null 2>&1
rm -f /var/run/mfrisbeed.pid
fi
;;
stop)
echo -n ' mfrisbeed'
if [ -f /var/run/mfrisbeed_wrapper.pid ]; then
kill `cat /var/run/mfrisbeed_wrapper.pid` >/dev/null 2>&1
rm -f /var/run/mfrisbeed_wrapper.pid
fi
if [ -f /var/run/mfrisbeed.pid ]; then
kill `cat /var/run/mfrisbeed.pid` >/dev/null 2>&1
rm -f /var/run/mfrisbeed.pid
fi
exit 0
;;
*)
echo "Usage: $0 {start|stop|restart}" >&2
exit 1
;;
esac
echo -n " mfrisbeed"
args="-C emulab"
# if an inner elab, use outer boss as our parent
if [ -n "@OUTERBOSS_NODENAME@" ]; then
args="$args -S @OUTERBOSS_NODENAME@"
fi
if [ -x @prefix@/sbin/daemon_wrapper ]; then
@prefix@/sbin/daemon_wrapper -i 30 -l @prefix@/log/mfrisbeed_wrapper.log \
@prefix@/sbin/mfrisbeed -d $args
else
@prefix@/sbin/mfrisbeed $args
fi
exit $?
...@@ -48,19 +48,10 @@ case "$1" in ...@@ -48,19 +48,10 @@ case "$1" in
if [ -x @prefix@/sbin/sslxmlrpc_server.py ]; then if [ -x @prefix@/sbin/sslxmlrpc_server.py ]; then
echo -n " sslxmlrpc_server" echo -n " sslxmlrpc_server"
@prefix@/sbin/sslxmlrpc_server.py @prefix@/sbin/sslxmlrpc_server.py 2>/dev/null
fi fi
if [ -x @prefix@/sbin/mfrisbeed ]; then # mfrisbeed started with its own script
echo -n " mfrisbeed"
if [ -x @prefix@/sbin/daemon_wrapper ]; then
@prefix@/sbin/daemon_wrapper \
-i 30 -l @prefix@/log/mfrisbeed_wrapper.log \
@prefix@/sbin/mfrisbeed
else
@prefix@/sbin/mfrisbeed
fi
fi
if [ -x @prefix@/sbin/reload_daemon ]; then if [ -x @prefix@/sbin/reload_daemon ]; then
echo -n " reloadd" echo -n " reloadd"
......
# #
# EMULAB-COPYRIGHT # EMULAB-COPYRIGHT
# Copyright (c) 2000-2010 University of Utah and the Flux Group. # Copyright (c) 2000-2011 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
# For installation. # For installation.
...@@ -17,7 +17,7 @@ SYSTEM := $(shell uname -s) ...@@ -17,7 +17,7 @@ SYSTEM := $(shell uname -s)
include $(OBJDIR)/Makeconf include $(OBJDIR)/Makeconf
RC_SCRIPTS = 2.mysql-server.sh 3.testbed.sh \ RC_SCRIPTS = 2.mysql-server.sh 3.mfrisbeed.sh 3.testbed.sh \
2.dhcpd.sh 1.mysql-client.sh 2.dhcpd.sh 1.mysql-client.sh
SUBBOSS_SCRIPTS = 2.dhcpd.sh SUBBOSS_SCRIPTS = 2.dhcpd.sh
OPS_SCRIPTS = 3.and.sh 1.mysql-client.sh 1.mysql-server.sh OPS_SCRIPTS = 3.and.sh 1.mysql-client.sh 1.mysql-server.sh
......
# #
# EMULAB-COPYRIGHT # EMULAB-COPYRIGHT
# Copyright (c) 2000-2010 University of Utah and the Flux Group. # Copyright (c) 2000-2011 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
...@@ -35,22 +35,19 @@ BIN_STUFF = power snmpit tbend tbprerun tbreport \ ...@@ -35,22 +35,19 @@ BIN_STUFF = power snmpit tbend tbprerun tbreport \
SBIN_STUFF = resetvlans console_setup.proxy sched_reload named_setup \ SBIN_STUFF = resetvlans console_setup.proxy sched_reload named_setup \
batch_daemon exports_setup reload_daemon sched_reserve \ batch_daemon exports_setup reload_daemon sched_reserve \
console_reset db2ns bwconfig frisbeelauncher \ console_reset db2ns bwconfig \
frisbeeimage rmgroup mkgroup setgroups mkproj modgroups \ rmgroup mkgroup setgroups mkproj modgroups \
exports_setup.proxy vnode_setup eventsys_start \ exports_setup.proxy vnode_setup eventsys_start \
sfskey_update sfskey_update.proxy rmuser idleswap \ sfskey_update sfskey_update.proxy rmuser idleswap \
newnode_reboot savelogs.proxy eventsys.proxy \ newnode_reboot savelogs.proxy eventsys.proxy \
elabinelab snmpit.proxy panic node_attributes \ elabinelab snmpit.proxy panic node_attributes \
nfstrace plabinelab smbpasswd_setup smbpasswd_setup.proxy \ nfstrace plabinelab smbpasswd_setup smbpasswd_setup.proxy \
rmproj snmpit.proxynew snmpit.proxyv2 pool_daemon \ rmproj snmpit.proxynew snmpit.proxyv2 pool_daemon \
checknodes_daemon subboss_frisbeelauncher_wrapper \ checknodes_daemon
subboss_wrapper
ifeq ($(ISMAINSITE),1) ifeq ($(ISMAINSITE),1)
SBIN_STUFF += repos_daemon SBIN_STUFF += repos_daemon
endif endif
SUBBOSS_SBIN_STUFF = subboss_frisbeelauncher subboss_frisbeeimage
CTRLSBIN_STUFF = console_setup.proxy sfskey_update.proxy \ CTRLSBIN_STUFF = console_setup.proxy sfskey_update.proxy \
savelogs.proxy eventsys.proxy savelogs.proxy eventsys.proxy
...@@ -95,11 +92,10 @@ LIB_STUFF = libtbsetup.pm exitonwarn.pm libtestbed.pm snmpit_intel.pm \ ...@@ -95,11 +92,10 @@ LIB_STUFF = libtbsetup.pm exitonwarn.pm libtestbed.pm snmpit_intel.pm \
# These scripts installed setuid, with sudo. # These scripts installed setuid, with sudo.
SETUID_BIN_SCRIPTS = node_reboot eventsys_control tarfiles_setup savelogs \ SETUID_BIN_SCRIPTS = node_reboot eventsys_control tarfiles_setup savelogs \
tbrsync tbrsync
SETUID_SBIN_SCRIPTS = mkproj rmgroup mkgroup frisbeelauncher frisbeeimage \ SETUID_SBIN_SCRIPTS = mkproj rmgroup mkgroup \
rmuser idleswap named_setup exports_setup \ rmuser idleswap named_setup exports_setup \
sfskey_update setgroups newnode_reboot vnode_setup \ sfskey_update setgroups newnode_reboot vnode_setup \
elabinelab nfstrace rmproj subboss_frisbeelauncher_wrapper \ elabinelab nfstrace rmproj
subboss_wrapper
SETUID_LIBX_SCRIPTS = console_setup spewlogfile SETUID_LIBX_SCRIPTS = console_setup spewlogfile
ifeq ($(SYSTEM),FreeBSD) ifeq ($(SYSTEM),FreeBSD)
...@@ -235,14 +231,6 @@ endif ...@@ -235,14 +231,6 @@ endif
chmod u+s $(INSTALL_SBINDIR)/rmgroup chmod u+s $(INSTALL_SBINDIR)/rmgroup
chown root $(INSTALL_SBINDIR)/mkgroup chown root $(INSTALL_SBINDIR)/mkgroup
chmod u+s $(INSTALL_SBINDIR)/mkgroup chmod u+s $(INSTALL_SBINDIR)/mkgroup
chown root $(INSTALL_SBINDIR)/frisbeelauncher
chmod u+s $(INSTALL_SBINDIR)/frisbeelauncher
chown root $(INSTALL_SBINDIR)/subboss_frisbeelauncher_wrapper
chmod u+s $(INSTALL_SBINDIR)/subboss_frisbeelauncher_wrapper
chown root $(INSTALL_SBINDIR)/subboss_wrapper
chmod u+s $(INSTALL_SBINDIR)/subboss_wrapper
chown root $(INSTALL_SBINDIR)/frisbeeimage
chmod u+s $(INSTALL_SBINDIR)/frisbeeimage
chown root $(INSTALL_SBINDIR)/rmuser chown root $(INSTALL_SBINDIR)/rmuser
chmod u+s $(INSTALL_SBINDIR)/rmuser chmod u+s $(INSTALL_SBINDIR)/rmuser
chown root $(INSTALL_SBINDIR)/idleswap chown root $(INSTALL_SBINDIR)/idleswap
...@@ -278,11 +266,6 @@ endif ...@@ -278,11 +266,6 @@ endif
chown root $(INSTALL_SBINDIR)/nfstrace chown root $(INSTALL_SBINDIR)/nfstrace
chmod u+s $(INSTALL_SBINDIR)/nfstrace