Commit 9036d314 authored by Mike Hibler's avatar Mike Hibler

Support 64-bit FreeBSD on the server side.

NOTE: currently only for FreeBSD 7.3 installs because that is the only
set of boss/ops/fs packages I have built so far!

This mostly involved minor changes to event agents. Too often we were
passing a pointer to a "long" to *get_int32, which on a 64-bit x86 OS would
fill the wrong half of a 64-bit variable. There was also one instance of
TCL code that had to be tweaked to account for 32- vs 64-bit.

These changes also required regeneration of SWIG stubs and an ugly change
to the SWIG generated code to use va_copy rather than direct assignment in
a couple of places.

Also related to SWIG is ensuring that the components that go into the
perl/python stub .so files are built with PIC. The amd64 linker requires
this.

The meta-ports had to be changed to reflect that linuxthreads and
ulsshxmlrpcpp don't work on amd64. The former had little effect as we
had mostly eliminated uses of linuxthreads already. The one thing that
did change was that we do not build nfstrace on amd64 (and we don't
currently use this anyway). Removing ulsshxmlrpcpp required switching
to the new event scheduler (event/new_sched) that Ryan did awhile back.
Note that it is only "new" in the sense that it uses a standard XMLRPC
package, there should be no functional differences. However, to be safe
we only use new_sched as the standard scheduler on 64-bit server installs.

Finally, added support to elabinelab setup to do a 64-bit server install.
Just specify FBSD73-64-STD as the boss/ops/fs osid and rc.mkelab should
do the rest.

That is pretty much it other than some random nits here and there.
parent 997b21b5
......@@ -175,7 +175,7 @@ ifeq ($(STANDALONE_CLEARINGHOUSE),0)
-chmod 777 $(INSTALL_TOPDIR)/exparchive/Archive
-mkdir -p $(INSTALL_TOPDIR)/images
-chmod 775 $(INSTALL_TOPDIR)/images
-ln -s /usr/testbed/bin/nse $(INSTALL_TOPDIR)/bin
-ln -sf /usr/testbed/bin/nse $(INSTALL_TOPDIR)/bin
endif
just-builddirs:
......
/*
* EMULAB-COPYRIGHT
* Copyright (c) 2000-2004, 2006 University of Utah and the Flux Group.
* Copyright (c) 2000-2011 University of Utah and the Flux Group.
* All rights reserved.
*/
......@@ -429,7 +429,8 @@ reset_callback(event_handle_t handle,
char buf[BUFSIZ];
char objname[TBDB_FLEN_EVOBJNAME];
char *prog = "delaysetup";
unsigned long token = ~0;
unsigned long token;
int32_t itoken = ~0;
int errcode = 0;
info("Got a RESET event!\n");
......@@ -441,7 +442,8 @@ reset_callback(event_handle_t handle,
errcode = system(buf);
event_notification_get_int32(handle, notification,
"TOKEN", (int32_t *)&token);
"TOKEN", &itoken);
token = itoken;
event_notification_get_objname(handle, notification,
objname, sizeof(objname));
......
/*
* 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.
*/
......@@ -35,7 +35,7 @@ static pid_t linktest_pid;
static char *pideid;
static char *swapper;
static event_handle_t handle;
static unsigned long token = ~0;
static int32_t token = ~0;
static char *nodelocal_dir;
static void callback(event_handle_t handle,
......@@ -254,7 +254,7 @@ callback(event_handle_t handle, event_notification_t notification, void *data)
}
event_notification_get_int32(handle, notification,
"TOKEN", (int32_t *)&token);
"TOKEN", &token);
event_notification_get_arguments(handle,
notification, args, sizeof(args));
......@@ -362,7 +362,7 @@ exec_linktest(char *args, int buflen) {
i=1;
snprintf(swapperarg, sizeof(swapperarg), "SWAPPER=%s", swapper);
argv[i++] = swapperarg;
snprintf(tokenarg, sizeof(tokenarg), "TOKEN=%lu", token);
snprintf(tokenarg, sizeof(tokenarg), "TOKEN=%u", token);
argv[i++] = tokenarg;
if (nodelocal_dir) {
snprintf(logdirarg, sizeof(logdirarg),
......
......@@ -1026,7 +1026,8 @@ callback(event_handle_t handle, event_notification_t notification, void *data)
char args[BUFSIZ];
struct proginfo *pinfo;
struct timeval now;
unsigned long token = ~0;
unsigned long token;
int32_t itoken = ~0;
assert(handle != NULL);
assert(notification != NULL);
......@@ -1061,7 +1062,8 @@ callback(event_handle_t handle, event_notification_t notification, void *data)
}
event_notification_get_int32(handle, notification,
"TOKEN", (int32_t *)&token);
"TOKEN", &itoken);
token = itoken;
/* ... dispatch the event. */
if (strcmp(event, TBDB_EVENTTYPE_START) == 0 ||
......@@ -1242,7 +1244,8 @@ reload_callback(event_handle_t handle,
{
char event[TBDB_FLEN_EVEVENTTYPE];
char objname[TBDB_FLEN_EVOBJTYPE];
unsigned long token = ~0;
unsigned long token;
int32_t itoken = ~0;
assert(handle != NULL);
assert(notification != NULL);
......@@ -1259,7 +1262,8 @@ reload_callback(event_handle_t handle,
return;
}
event_notification_get_int32(handle, notification,
"TOKEN", (int32_t *)&token);
"TOKEN", &itoken);
token = itoken;
if (strcmp(event, TBDB_EVENTTYPE_RELOAD) == 0) {
info("startrun_callback: Got a reload event.\n");
......
/*
* EMULAB-COPYRIGHT
* Copyright (c) 2003-2007 University of Utah and the Flux Group.
* Copyright (c) 2003-2011 University of Utah and the Flux Group.
* All rights reserved.
*/
......@@ -119,6 +119,7 @@ callback(event_handle_t handle, event_notification_t notification, void *data)
char objecttype[TBDB_FLEN_EVOBJTYPE];
char objectname[TBDB_FLEN_EVOBJNAME];
struct timeval now, then, diff;
int32_t sec, usec;
gettimeofday(&now, NULL);
......@@ -128,10 +129,10 @@ callback(event_handle_t handle, event_notification_t notification, void *data)
notification, objecttype, sizeof(objecttype));
event_notification_get_objname(handle,
notification, objectname, sizeof(objectname));
event_notification_get_int32(handle, notification, "time_usec",
(int *) &then.tv_usec);
event_notification_get_int32(handle, notification, "time_sec",
(int *) &then.tv_sec);
event_notification_get_int32(handle, notification, "time_usec", &usec);
event_notification_get_int32(handle, notification, "time_sec", &sec);
then.tv_sec = sec;
then.tv_usec = usec;
timersub(&now, &then, &diff);
info("%s %s %s %d %d %d %d %d %d\n", eventtype, objecttype,
......
......@@ -20,6 +20,14 @@ PUBSUBMTFLAGS += -DELVIN_COMPAT
endif
SYSTEM := $(shell uname -s)
ARCH := $(shell uname -m)
# We should be able to use va_copy everywhere, but be conservative
SWIGCFLAGS =
ifeq ($(ARCH),amd64)
SWIGCFLAGS += -DHAVE_VA_COPY
endif
LIBS = libevent.a
SWIGLIBS =
# Re-entrant, multi-threaded version on FreeBSD and Linux, not on Windows.
......@@ -84,8 +92,12 @@ event_r.o: event.c
event.o: event.c
$(CC) $(SCFLAGS) -c -o event.o $<
event.So: event.c
$(CC) -fpic -DPIC $(SCFLAGS) -c -o event.So $<
util.o: util.c
$(CC) $(SCFLAGS) -c -o util.o $<
util.So: util.c
$(CC) -fpic -DPIC $(SCFLAGS) -c -o util.So $<
#
# These three targets are for the perl binding to the event system
......@@ -102,7 +114,9 @@ swig-wrappers: event.i event.c event.pm.tail
cat $(SRCDIR)/event.pm.tail >> $(SRCDIR)/event.pm
event_wrap.o: $(SRCDIR)/event_wrap.c
$(CC) -c $(CFLAGS_NOWARN) $(PCORE) $<
$(CC) -c $(SWIGCFLAGS) $(CFLAGS_NOWARN) $(PCORE) $<
event_wrap.So: $(SRCDIR)/event_wrap.c
$(CC) -fpic -DPIC -c $(SWIGCFLAGS) $(CFLAGS_NOWARN) $(PCORE) -o event_wrap.So $<
#
# Note: The python version of the wrappers do not seem to be afflicted by the
......@@ -117,12 +131,14 @@ swig-pywrappers: event.i event.h event.c tbevent.py.tail
# $(SRCDIR)/event_wrap_py.c: swig-pywrappers
event_wrap_py.o: $(SRCDIR)/event_wrap_py.c event.h
$(CC) -c $(CFLAGS_NOWARN) $(PYCORE) $<
$(CC) -c $(SWIGCFLAGS) $(CFLAGS_NOWARN) $(PYCORE) $<
event_wrap_py.So: $(SRCDIR)/event_wrap_py.c event.h
$(CC) -fpic -DPIC -c $(SWIGCFLAGS) $(CFLAGS_NOWARN) $(PYCORE) -o event_wrap_py.So $<
event.so: event.o event_wrap.o util.o
event.so: event.So event_wrap.So util.So
ld -shared $^ $(PUBSUBLIB) -lcrypto -o event.so
_tbevent.so: event.o event_wrap_py.o util.o
_tbevent.so: event.So event_wrap_py.So util.So
ld -shared $^ $(PUBSUBLIB) -lcrypto -o $@
LIB_STUFF = event.pm event.so tbevent.py _tbevent.so
......@@ -155,7 +171,7 @@ client-pllibinstall: event.so
$(INSTALL_PROGRAM) event.so $(DESTDIR)$(CLIENT_BINDIR)/event.so
clean:
/bin/rm -f *.o libevent.a libevent_r.a *.so *.py
/bin/rm -f *.o libevent.a libevent_r.a *.So *.so *.py
distclean:
/bin/rm -f event.pm event_wrap.c event_wrap_py.c tbevent.py
......
......@@ -21,6 +21,7 @@
#include <assert.h>
#include <errno.h>
#include <string.h>
#include <stdarg.h>
#include <unistd.h>
#include <netdb.h>
#include <limits.h>
......
......@@ -10,7 +10,7 @@ use base qw(DynaLoader);
package eventc;
bootstrap event;
package event;
@EXPORT = qw($MAXHOSTNAMELEN event_handle_server_set event_handle_server_get event_handle_status_set event_handle_status_get event_handle_keydata_set event_handle_keydata_get event_handle_keylen_set event_handle_keylen_get event_handle_do_loop_set event_handle_do_loop_get event_handle_connect_set event_handle_connect_get event_handle_disconnect_set event_handle_disconnect_get event_handle_mainloop_set event_handle_mainloop_get event_handle_notify_set event_handle_notify_get event_handle_subscribe_set event_handle_subscribe_get event_handle_unsubscribe_set event_handle_unsubscribe_get new_event_handle delete_event_handle event_notification_pubsub_notification_set event_notification_pubsub_notification_get event_notification_has_hmac_set event_notification_has_hmac_get new_event_notification delete_event_notification address_tuple_site_set address_tuple_site_get address_tuple_expt_set address_tuple_expt_get address_tuple_group_set address_tuple_group_get address_tuple_host_set address_tuple_host_get address_tuple_objtype_set address_tuple_objtype_get address_tuple_objname_set address_tuple_objname_get address_tuple_eventtype_set address_tuple_eventtype_get address_tuple_scheduler_set address_tuple_scheduler_get address_tuple_timeline_set address_tuple_timeline_get new_address_tuple delete_address_tuple $ADDRESSTUPLE_ALL $OBJECTTYPE_TESTBED $OBJECTTYPE_TRAFGEN address_tuple_alloc address_tuple_free $EVENT_HOST_ANY $EVENT_NULL $EVENT_TEST $EVENT_SCHEDULE $EVENT_TRAFGEN_START $EVENT_TRAFGEN_STOP event_register event_register_withkeyfile event_register_withkeydata event_register_withkeyfile_withretry event_register_withkeydata_withretry event_unregister c_event_poll c_event_poll_blocking dont_use_this_function_because_it_does_not_work event_stop_main event_notify event_schedule event_notification_alloc event_notification_free event_notification_clone event_notification_get_double event_notification_get_int32 event_notification_get_int64 event_notification_get_opaque_length event_notification_get_string_length event_notification_get_opaque c_event_notification_get_string event_notification_put_double event_notification_put_int32 event_notification_put_int64 event_notification_put_opaque event_notification_put_string event_notification_remove c_event_subscribe event_subscribe_auth event_async_subscribe event_unsubscribe event_async_unsubscribe event_notification_insert_hmac event_set_idle_period event_set_failover event_arg_get event_arg_dup $EA_TAG_DONE $EA_Site $EA_Experiment $EA_Group $EA_Host $EA_Type $EA_Name $EA_Event $EA_Arguments $EA_ArgInteger $EA_ArgFloat $EA_ArgString $EA_When event_notification_create_v event_notification_create event_do_v event_do xmalloc xrealloc make_timestamp timeval_tv_sec_set timeval_tv_sec_get timeval_tv_usec_set timeval_tv_usec_get new_timeval delete_timeval callback_data_callback_notification_set callback_data_callback_notification_get callback_data_next_set callback_data_next_get new_callback_data delete_callback_data $callback_data_list allocate_callback_data free_callback_data dequeue_callback_data enqueue_callback_data perl_stub_callback stub_event_subscribe $event_string_buffer event_notification_get_string event_notification_get_site event_notification_get_expt event_notification_get_group event_notification_get_host event_notification_get_objtype event_notification_get_objname event_notification_get_eventtype event_notification_get_arguments event_notification_set_arguments event_notification_get_sender event_notification_set_sender );
@EXPORT = qw($EVENT_LIBRARY_VERSION $MAXHOSTNAMELEN event_handle_server_set event_handle_server_get event_handle_status_set event_handle_status_get event_handle_keydata_set event_handle_keydata_get event_handle_keylen_set event_handle_keylen_get event_handle_do_loop_set event_handle_do_loop_get event_handle_connect_set event_handle_connect_get event_handle_disconnect_set event_handle_disconnect_get event_handle_mainloop_set event_handle_mainloop_get event_handle_notify_set event_handle_notify_get event_handle_subscribe_set event_handle_subscribe_get event_handle_unsubscribe_set event_handle_unsubscribe_get new_event_handle delete_event_handle event_notification_pubsub_notification_set event_notification_pubsub_notification_get event_notification_has_hmac_set event_notification_has_hmac_get new_event_notification delete_event_notification address_tuple_site_set address_tuple_site_get address_tuple_expt_set address_tuple_expt_get address_tuple_group_set address_tuple_group_get address_tuple_host_set address_tuple_host_get address_tuple_objtype_set address_tuple_objtype_get address_tuple_objname_set address_tuple_objname_get address_tuple_eventtype_set address_tuple_eventtype_get address_tuple_scheduler_set address_tuple_scheduler_get address_tuple_timeline_set address_tuple_timeline_get new_address_tuple delete_address_tuple $ADDRESSTUPLE_ALL $OBJECTTYPE_TESTBED $OBJECTTYPE_TRAFGEN address_tuple_alloc address_tuple_free $EVENT_HOST_ANY $EVENT_NULL $EVENT_TEST $EVENT_SCHEDULE $EVENT_TRAFGEN_START $EVENT_TRAFGEN_STOP event_register event_register_withkeyfile event_register_withkeydata event_register_withkeyfile_withretry event_register_withkeydata_withretry event_unregister c_event_poll c_event_poll_blocking dont_use_this_function_because_it_does_not_work event_stop_main event_notify event_schedule event_notification_alloc event_notification_free event_notification_clone event_notification_get_double event_notification_get_int32 event_notification_get_int64 event_notification_get_opaque_length event_notification_get_string_length event_notification_get_opaque c_event_notification_get_string event_notification_put_double event_notification_put_int32 event_notification_put_int64 event_notification_put_opaque event_notification_put_string event_notification_remove c_event_subscribe event_subscribe_auth event_async_subscribe event_unsubscribe event_async_unsubscribe event_notification_insert_hmac event_set_idle_period event_set_failover event_arg_get event_arg_dup $EA_TAG_DONE $EA_Site $EA_Experiment $EA_Group $EA_Host $EA_Type $EA_Name $EA_Event $EA_Arguments $EA_ArgInteger $EA_ArgFloat $EA_ArgString $EA_When event_notification_create_v event_notification_create event_do_v event_do xmalloc xrealloc make_timestamp timeval_tv_sec_set timeval_tv_sec_get timeval_tv_usec_set timeval_tv_usec_get new_timeval delete_timeval callback_data_callback_notification_set callback_data_callback_notification_get callback_data_next_set callback_data_next_get new_callback_data delete_callback_data $callback_data_list allocate_callback_data free_callback_data dequeue_callback_data enqueue_callback_data perl_stub_callback stub_event_subscribe $event_string_buffer event_notification_get_string event_notification_get_site event_notification_get_expt event_notification_get_group event_notification_get_host event_notification_get_objtype event_notification_get_objname event_notification_get_eventtype event_notification_get_arguments event_notification_set_arguments event_notification_get_sender event_notification_set_sender );
# ---------- BASE METHODS -------------
......@@ -356,6 +356,7 @@ sub ACQUIRE {
package event;
*EVENT_LIBRARY_VERSION = *eventc::EVENT_LIBRARY_VERSION;
*MAXHOSTNAMELEN = *eventc::MAXHOSTNAMELEN;
*ADDRESSTUPLE_ALL = *eventc::ADDRESSTUPLE_ALL;
*OBJECTTYPE_TESTBED = *eventc::OBJECTTYPE_TESTBED;
......
......@@ -1537,6 +1537,26 @@ SWIGEXPORT void SWIG_init (CV *cv, CPerlObj *);
#include "event.h"
SWIGINTERNINLINE SV *
SWIG_FromCharPtrAndSize(const char* carray, size_t size)
{
SV *obj = sv_newmortal();
if (carray) {
sv_setpvn(obj, carray, size);
} else {
sv_setsv(obj, &PL_sv_undef);
}
return obj;
}
SWIGINTERNINLINE SV *
SWIG_FromCharPtr(const char *cptr)
{
return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
}
SWIGINTERNINLINE SV *
SWIG_From_long SWIG_PERL_DECL_ARGS_1(long value)
{
......@@ -1737,26 +1757,6 @@ SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc)
SWIGINTERNINLINE SV *
SWIG_FromCharPtrAndSize(const char* carray, size_t size)
{
SV *obj = sv_newmortal();
if (carray) {
sv_setpvn(obj, carray, size);
} else {
sv_setsv(obj, &PL_sv_undef);
}
return obj;
}
SWIGINTERNINLINE SV *
SWIG_FromCharPtr(const char *cptr)
{
return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
}
SWIGINTERN int
SWIG_AsVal_unsigned_SS_long SWIG_PERL_DECL_ARGS_2(SV *obj, unsigned long *val)
{
......@@ -5666,7 +5666,12 @@ XS(_wrap_event_notification_create_v) {
if (!argp4) {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "event_notification_create_v" "', argument " "4"" of type '" "va_list""'");
} else {
arg4 = *((va_list *)(argp4));
#ifdef HAVE_VA_COPY
/* XXX hand-tweaked by mike to use va_copy rather than assignment */
va_copy(arg4, *((va_list *)(argp4)));
#else
arg4 = *((va_list *)(argp4));
#endif
}
}
result = (event_notification_t)event_notification_create_v(arg1,arg2,arg3,arg4);
......@@ -5759,7 +5764,12 @@ XS(_wrap_event_do_v) {
if (!argp3) {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "event_do_v" "', argument " "3"" of type '" "va_list""'");
} else {
arg3 = *((va_list *)(argp3));
#ifdef HAVE_VA_COPY
/* XXX hand-tweaked by mike to use va_copy rather than assignment */
va_copy(arg3, *((va_list *)(argp3)));
#else
arg3 = *((va_list *)(argp3));
#endif
}
}
result = (int)event_do_v(arg1,arg2,arg3);
......@@ -7487,6 +7497,11 @@ XS(SWIG_init) {
SvREADONLY_on(sv);
}
/*@SWIG:/usr/local/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
SV *sv = get_sv((char*) SWIG_prefix "EVENT_LIBRARY_VERSION", TRUE | 0x2 | GV_ADDMULTI);
sv_setsv(sv, SWIG_FromCharPtr("1.0"));
SvREADONLY_on(sv);
} while(0) /*@SWIG@*/;
/*@SWIG:/usr/local/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
SV *sv = get_sv((char*) SWIG_prefix "MAXHOSTNAMELEN", TRUE | 0x2 | GV_ADDMULTI);
sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(64)));
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -271,6 +271,15 @@ else {
die("Could not determine what version of FreeBSD you are running!\n");
}
# Architecture
my $FBSD_ARCH = "i386";
if (`uname -m` =~ /^(\S+)$/) {
$FBSD_ARCH = $1;
}
else {
die("Could not determine what architecutre FreeBSD is running on!\n");
}
#
# Find out our domain name, so that we can qualify the localhost entry
#
......@@ -551,8 +560,8 @@ sub doboot()
}
elsif ($FBSD_VERSION == 7.3) {
$emulabconfig{FS_PKG_DIR} = "/share/freebsd/7.3/packages";
$emulabconfig{FS_PKG_DIR} .= ".elvincompat"
if ($emulabconfig{"CONFIG_ELVIN"});
$emulabconfig{FS_PKG_DIR} .= "-64"
if ($FBSD_ARCH eq "amd64");
$emulabconfig{OPS_PKG_DIR} = $emulabconfig{FS_PKG_DIR};
$emulabconfig{BOSS_PKG_DIR} = $emulabconfig{FS_PKG_DIR};
$emulabconfig{FS_PKG} = "emulab-fs-3.1";
......@@ -561,8 +570,6 @@ sub doboot()
}
elsif ($FBSD_VERSION >= 8.2 && $FBSD_VERSION < 9.0) {
$emulabconfig{FS_PKG_DIR} = "/share/freebsd/8.2/packages";
$emulabconfig{FS_PKG_DIR} .= ".elvincompat"
if ($emulabconfig{"CONFIG_ELVIN"});
$emulabconfig{OPS_PKG_DIR} = $emulabconfig{FS_PKG_DIR};
$emulabconfig{BOSS_PKG_DIR} = $emulabconfig{FS_PKG_DIR};
$emulabconfig{FS_PKG} = "emulab-fs-4.0";
......@@ -573,8 +580,6 @@ sub doboot()
}
elsif ($FBSD_VERSION >= 9.0) {
$emulabconfig{FS_PKG_DIR} = "/share/freebsd/9.0/packages";
$emulabconfig{FS_PKG_DIR} .= ".elvincompat"
if ($emulabconfig{"CONFIG_ELVIN"});
$emulabconfig{OPS_PKG_DIR} = $emulabconfig{FS_PKG_DIR};
$emulabconfig{BOSS_PKG_DIR} = $emulabconfig{FS_PKG_DIR};
$emulabconfig{FS_PKG} = "emulab-fs-5.0";
......@@ -693,7 +698,7 @@ sub doboot()
;
}
else {
fatal("Do not recognize role '". $emulabconfig{"ROLE"} ."'!\n");
fatal("Do not recognize role '". $emulabconfig{"ROLE"}. "'!\n");
}
print "Done!\n";
return 0;
......@@ -1415,6 +1420,7 @@ sub SetupOpsNode($)
if ($FBSD_VERSION == 7.3) {
system("pkg_delete -f -x python25 -x py25");
system("pkg_delete -f -x sudo -x png -x tiff");
system("pkg_delete -f -x git -x rpm -x p5-libwww");
}
print "Installing the ops metaport.\n";
......@@ -2081,6 +2087,7 @@ sub SetupBossNode($)
if ($FBSD_VERSION == 7.3) {
system("pkg_delete -f -x python25 -x py25");
system("pkg_delete -f -x sudo -x png -x tiff");
system("pkg_delete -f -x git -x rpm -x p5-libwww");
}
if (-e "$pdir/emacs-23") {
......@@ -2704,6 +2711,7 @@ sub SetupOpsJail()
if ($FBSD_VERSION == 7.3) {
system("pkg_delete -f -x python25 -x py25");
system("pkg_delete -f -x sudo -x png -x tiff");
system("pkg_delete -f -x git -x rpm -x p5-libwww");
}
print "Installing the ops metaport.\n";
......@@ -3421,7 +3429,7 @@ sub RecreateDir($$)
mysystem("sed -i '.orig' -E '\\;\[\[:space:\]\]$TBDIR\[\[:space:\]\];d' /etc/fstab");
}
# remove it if it is empty
rmdir("$dir >/dev/null 2>&1");
rmdir($dir);
}
#
......@@ -3439,4 +3447,3 @@ sub RecreateDir($$)
mysystem("mkdir -p $dir");
}
}
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -13,14 +13,20 @@ ISMAINSITE = @TBMAINSITE@
include $(OBJDIR)/Makeconf
SYSTEM := $(shell uname -s)
ARCH := $(shell uname -m)
SUBDIRS = proxy example
SUBDIRS = proxy
ifeq ($(SYSTEM),FreeBSD)
SUBDIRS += sched stated
ifeq ($(ARCH),amd64)
SUBDIRS += new_sched
else
SUBDIRS += sched
ifeq ($(ISMAINSITE),1)
SUBDIRS += new_sched
endif
endif
SUBDIRS += stated
endif
all: etc-subdir all-subdirs
......@@ -29,23 +35,12 @@ include $(TESTBED_SRCDIR)/GNUmakerules
etc-subdir:
@$(MAKE) -C etc all
install:
@$(MAKE) -C sched install
ifeq ($(ISMAINSITE),1)
@$(MAKE) -C new_sched install
endif
@$(MAKE) -C stated install
@$(MAKE) -C proxy install
install: install-subdirs
client: client-subdirs
client-install: client client-install-subdirs
control-install:
@$(MAKE) -C sched control-install
ifeq ($(ISMAINSITE),1)
@$(MAKE) -C new_sched control-install
endif
@$(MAKE) -C proxy control-install
control-install: control-install-subdirs
post-install:
......
......@@ -11,11 +11,13 @@ SUBDIR = event/new_sched
include $(OBJDIR)/Makeconf
ARCH := $(shell uname -m)
all: event-sched_rrpc
include $(TESTBED_SRCDIR)/GNUmakerules
CFLAGS += -g -pthread -DBINDIR='"$(INSTALL_BINDIR)"'
CFLAGS += -g -D_THREAD_SAFE -pthread -DBINDIR='"$(INSTALL_BINDIR)"'
CFLAGS += -DSBINDIR='"$(INSTALL_SBINDIR)"'
#CFLAGS += -DDEBUG
CFLAGS += -O -Wall
......@@ -27,7 +29,7 @@ LDFLAGS += -pthread
LDFLAGS += -L${TESTBED_LIBOBJDIR}/event -L${TESTBED_LIBOBJDIR}/libtb
LDFLAGS += $(LDSTATIC)
DBLIBS = -L/usr/local/lib/mysql -lmysqlclient -lz
LIBS += -levent_r -ltb -lz
LIBS += -lpthread -levent_r -ltb -lz
XMLRPCINC = `xmlrpc-c-config c++2 client --cflags`
CXXFLAGS += -pthread -O $(XMLRPCINC) -I$(OBJDIR)
......@@ -62,7 +64,7 @@ OBJS = \
timeline-agent.o \
version.o
event-sched_rrpc: $(OBJS) event-sched.h ${TESTBED_LIBOBJDIR}/event/libevent.a
event-sched_rrpc: $(OBJS) event-sched.h $(TESTBED_LIBOBJDIR)/event/libevent.a
$(CXX) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(XMLRPCLIBS) $(LIBS)
DEPS = \
......@@ -90,6 +92,9 @@ rrpc.o: rpc.cc $(DEPS)
install: event-sched_rrpc
-mkdir -p $(INSTALL_DIR)/opsdir/sbin
$(INSTALL_PROGRAM) $< $(INSTALL_DIR)/opsdir/sbin/new-event-sched
ifeq ($(ARCH),amd64)
ln -sf new-event-sched $(INSTALL_DIR)/opsdir/sbin/event-sched
endif
-mkdir -p $(INSTALL_DIR)/opsdir/man/man8
$(INSTALL) -m 0644 $(SRCDIR)/event-sched.8 \
$(INSTALL_DIR)/opsdir/man/man8/event-sched.8
......@@ -99,6 +104,9 @@ install: event-sched_rrpc
control-install: event-sched_rrpc
$(INSTALL_PROGRAM) $< $(INSTALL_SBINDIR)/new-event-sched
ifeq ($(ARCH),amd64)
ln -sf new-event-sched $(INSTALL_SBINDIR)/event-sched
endif
# not a client thing
client:
......
/*
* EMULAB-COPYRIGHT
* Copyright (c) 2004, 2005, 2007 University of Utah and the Flux Group.
* Copyright (c) 2004-2011 University of Utah and the Flux Group.
* All rights reserved.
*/
......@@ -208,7 +208,8 @@ static void *console_agent_looper(void *arg)
}
else {
struct agent **agent_array, *agent_singleton[1];
int rc, lpc, token = ~0;
int rc, lpc;
int32_t token = ~0;
event_notification_get_arguments(handle,
en,
......@@ -217,7 +218,7 @@ static void *console_agent_looper(void *arg)
event_notification_get_int32(handle,
en,
"TOKEN",
(int32_t *)&token);
&token);
argsbuf[sizeof(argsbuf) - 1] = '\0';
if (strcmp(evtype, TBDB_EVENTTYPE_START) == 0) {
......
/*
* 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.
*/
......@@ -81,7 +81,7 @@ static struct lnList timelines;
static struct lnList sequences;
static struct lnList groups;
unsigned long next_token;
int32_t next_token;
simulator_agent_t primary_simulator_agent;
......@@ -730,7 +730,7 @@ enqueue(event_handle_t handle, event_notification_t notification, void *data)
char eventtype[TBDB_FLEN_EVEVENTTYPE];
struct agent *agentp;
timeline_agent_t ta = NULL;
int token;
int32_t sec, usec, token;
if (! event_notification_get_timeline(handle, notification,
timeline,
......@@ -739,11 +739,16 @@ enqueue(event_handle_t handle, event_notification_t notification, void *data)
/* Not fatal since we have to deal with legacy systems. */
}
/* Get the event's firing time: */
/*
* Get the event's firing time.
* Note that the timeval fields are not necessarily 32-bits,
* so we cannot just pass in addresses to tv_sec and tv_usec;
* assign to tmps instead.
*/
if (! event_notification_get_int32(handle, notification, "time_usec",
(int *) &event.time.tv_usec) ||
(int *) &usec) ||
! event_notification_get_int32(handle, notification, "time_sec",
(int *) &event.time.tv_sec)) {
(int *) &sec)) {
error("could not get time from notification %p\n",
notification);
}
......@@ -775,6 +780,8 @@ enqueue(event_handle_t handle, event_notification_t notification, void *data)
event.agent.s = agentp;
event.length = 1;
event.flags = SEF_SINGLE_HANDLER;
event.time.tv_sec = sec;
event.time.tv_usec = usec;
/*
* Clone the event notification, since we want the
......@@ -826,7 +833,7 @@ enqueue(event_handle_t handle, event_notification_t notification, void *data)
make_timestamp(time_buf_1, &event.time);
make_timestamp(time_buf_2, &now);
info("Sched: "
"note:%p at:%s now:%s agent:%s %s\n",
event.notification,
......@@ -855,7 +862,7 @@ enqueue(event_handle_t handle, event_notification_t notification, void *data)
if (! event_notification_get_int32(handle,
event.notification,
"TOKEN",
(int32_t *)&token)) {
&token)) {
event_notification_put_int32(handle,
event.notification,
"TOKEN",
......
/*
* EMULAB-COPYRIGHT
* Copyright (c) 2000-2005 University of Utah and the Flux Group.
* Copyright (c) 2000-2011 University of Utah and the Flux Group.
* All rights reserved.
*/
......@@ -79,7 +79,7 @@ extern char pideid[BUFSIZ];
extern char *pid, *eid;
extern int debug;
extern unsigned long next_token;
extern int32_t next_token;
/*
* Function prototypes:
......
/*
* EMULAB-COPYRIGHT
* Copyright (c) 2004, 2005 University of Utah and the Flux Group.
n * All rights reserved.
* Copyright (c) 2004-2011 University of Utah and the Flux Group.
* All rights reserved.
*/
#include "config.h"
......@@ -374,7 +374,8 @@ static void *node_agent_looper(void *arg)
}
else {
struct agent **agent_array, *agent_singleton[1];
int rc, lpc, token = ~0;
int rc, lpc;
int32_t token = ~0;
event_notification_get_arguments(handle,
en,
......@@ -383,7 +384,7 @@ static void *node_agent_looper(void *arg)
event_notification_get_int32(handle,
en,
"TOKEN",
(int32_t *)&token);
&token);
argsbuf[sizeof(argsbuf) - 1] = '\0';
if (se.length == 0) {
......
/*
* EMULAB-COPYRIGHT
* Copyright (c) 2000-2002, 2004 University of Utah and the Flux Group.
* Copyright (c) 2000-2011 University of Utah and the Flux Group.
* All rights reserved.
*/
......@@ -203,7 +203,7 @@ sched_event_dequeue(sched_event_t *event, int wait)
&event_queue_mutex, &fireme))
!= 0) {
if (err != ETIMEDOUT) {
error("pthread_cond_timedwait failed: %d", err);
error("pthread_cond_timedwait failed: %d\n", err);
return -1;
}
......
/*
* EMULAB-COPYRIGHT
* Copyright (c) 2004, 2005, 2006, 2007 University of Utah and the Flux Group.
* Copyright (c) 2004-2011 University of Utah and the Flux Group.
* All rights reserved.
*/
......@@ -541,7 +541,8 @@ static void *simulator_agent_looper(void *arg)
se.notification);
}
else {
int rc = 0, token = ~0;
int rc = 0;
int32_t token = ~0;
event_notification_get_arguments(handle,
se.notification,
......@@ -550,7 +551,7 @@ static void *simulator_agent_looper(void *arg)
event_notification_get_int32(handle,
se.notification,
"TOKEN",
(int32_t *)&token);
&token);
argsbuf[sizeof(argsbuf) - 1] = '\0';
/* Strictly for the event viewer */
......
/*
* EMULAB-COPYRIGHT
* Copyright (c) 2004, 2005, 2007 University of Utah and the Flux Group.
* Copyright (c) 2004-2011 University of Utah and the Flux Group.
* All rights reserved.
*/
......@@ -225,7 +225,7 @@ int sequence_agent_handle_complete(event_handle_t handle,
while (sa->ta_local_agent.la_link.ln_Succ != NULL) {
struct sched_event *seq_se = NULL;
struct agent *ag = NULL;
int token = -1;
int32_t token = -1;
if (sa->ta_current_event >= 0) {
seq_se = &sa->ta_events[sa->ta_current_event];
......@@ -325,7 +325,8 @@ static int timeline_agent_immediate(local_agent_t la, sched_event_t *se)
else if (strcmp(evtype, TBDB_EVENTTYPE_START) == 0 ||
strcmp(evtype, TBDB_EVENTTYPE_RUN) == 0) {
struct timeval now, then;
int token, lpc;
int lpc;
int32_t token;
if (strncmp(la->la_agent->name, "__", 2) != 0) {
RPC_grab();
......@@ -336,7 +337,7 @@ static int timeline_agent_immediate(local_agent_t la, sched_event_t *se)