diff --git a/BUILD.NOTES b/BUILD.NOTES
index 273a2d816622b539e78ca7f2c137b447adebe538..2d52a948d1eff86c2507101f290e4d113296f22a 100644
--- a/BUILD.NOTES
+++ b/BUILD.NOTES
@@ -42,8 +42,8 @@ Linux cluster (See BlueGene and AIX specific notes below for some differences).
    (.rpmrc for newer versions of rpmbuild) file containing:
 	%_slurm_sysconfdir      /etc/slurm
 	%_with_debug            1
+	%_with_sgijob		1
 	%_with_elan		1   (ONLY ON SYSTEMS WITH ELAN SWITCH)
-	%_with_sgijob		1   (ON SYSTEMS WITHOUT ELAN SWITCH)
    I usually build with using the following syntax:
    build  -s https://eris.llnl.gov/svn/slurm/tags/slurm-1-2-0-0-pre3
 4. Remove the RPMs that we don't want:
diff --git a/META b/META
index 8723309f560d0e1b1e016f37a22f9105a64a57be..671d636cd58cfe0d09f2484a46f57ce055555a0f 100644
--- a/META
+++ b/META
@@ -3,9 +3,9 @@
   Api_revision:  0
   Major:         1
   Meta:          1
-  Micro:         20
+  Micro:         21
   Minor:         2
   Name:          slurm
   Release:       1
-  Release_tags:  dist
-  Version:       1.2.20
+  Release_tags:  
+  Version:       1.2.21
diff --git a/NEWS b/NEWS
index 964b4f1c3e0d968e3e71e1d9bc4927ab6f08bbf1..512ca2c05aa310f9e68a60db8d439db4463dff0b 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,34 @@
 This file describes changes in recent versions of SLURM. It primarily
 documents those changes that are of interest to users and admins.
 
+* Changes in SLURM 1.2.22
+=========================
+
+
+* Changes in SLURM 1.2.21
+=========================
+ -- Fixed torque wrappers to look in the correct spot for the perl api
+ -- Do not treat user resetting his time limit to the current value as
+    an error.
+ -- Set correct executable names for Totalview when --multi-prog option 
+    is used and more than one node is allocated to the job step.
+ -- When a batch job gets requeued, record in accounting logs that 
+    the job was cancelled, the requeued job's submit time will be 
+    set to the time of its requeue so it looks like a different job.
+ -- Prevent communication problems if the slurmd/slurmstepd have a 
+    different JobAcct plugin configured than slurmctld.
+ -- Adding Gold plugin for job accounting
+ -- In sched/wiki2, add support for MODIFYJOB option "JOBNAME=<name>"
+    to modify a job's name.
+ -- Add configuration check for sys/syslog.h and include it as needed.
+ -- Add --propagate option to sbatch for control over limit propagation.
+ -- Added Gold interface to the jobacct plugin.  To configure in the config
+    file specify...  
+    JobAcctType=jobacct/gold
+    JobAcctLogFile=CLUSTER_NAME:GOLD_AUTH_KEY_FILE:GOLDD_HOST:GOLDD_PORT7112
+ -- In slurmctld job record, set begin_time to time when all of a job's
+    dependencies are met.
+
 * Changes in SLURM 1.2.20
 =========================
  -- In switch/federation, fix small memory leak effecting slurmd.
@@ -2738,4 +2766,4 @@ documents those changes that are of interest to users and admins.
  -- Change directory to /tmp in slurmd if daemonizing.
  -- Logfiles are reopened on reconfigure.
  
-$Id: NEWS 12712 2007-11-29 00:12:08Z jette $
+$Id: NEWS 12878 2007-12-20 18:20:03Z jette $
diff --git a/auxdir/x_ac_slurm_ssl.m4 b/auxdir/x_ac_slurm_ssl.m4
index a37587b0c5039dff2bd8f26ea3812b79724fb91b..9a8fe3b12b7ff069f1c5ce37cb81cbcb5f13d643 100644
--- a/auxdir/x_ac_slurm_ssl.m4
+++ b/auxdir/x_ac_slurm_ssl.m4
@@ -1,5 +1,5 @@
 ##*****************************************************************************
-## $Id: x_ac_slurm_ssl.m4 11096 2007-03-08 00:16:27Z jette $
+## $Id: x_ac_slurm_ssl.m4 12827 2007-12-14 22:29:30Z da $
 ##*****************************************************************************
 #  AUTHOR:
 #     Mark Grondona <mgrondona@llnl.gov>
@@ -87,6 +87,8 @@ AC_DEFUN([X_AC_SLURM_WITH_SSL], [
   		AC_RUN_IFELSE([AC_LANG_SOURCE([[
   #include <stdlib.h>
   #include <openssl/rand.h>
+  #include <openssl/hmac.h>
+  #include <openssl/sha.h>
   #define SIZE 8
   int main(void) 
   {
diff --git a/config.h.in b/config.h.in
index 52e9ee1ba3f611a1d25fefd8decbe481ccabd9c0..a9bb420bc0ba4ba2966f11068789ed3d33271b53 100644
--- a/config.h.in
+++ b/config.h.in
@@ -209,6 +209,9 @@
 /* Define to 1 if you have the <sys/sysctl.h> header file. */
 #undef HAVE_SYS_SYSCTL_H
 
+/* Define to 1 if you have the <sys/syslog.h> header file. */
+#undef HAVE_SYS_SYSLOG_H
+
 /* Define to 1 if you have the <sys/systemcfg.h> header file. */
 #undef HAVE_SYS_SYSTEMCFG_H
 
diff --git a/configure b/configure
index 005f7614fded59155d4989453ffd5d871a0dc638..f2a95f05732f70bdee8560158c7389866f8c063b 100755
--- a/configure
+++ b/configure
@@ -21248,6 +21248,7 @@ fi
 
 
 
+
 
 
 for ac_header in mcheck.h values.h socket.h sys/socket.h  \
@@ -21256,6 +21257,7 @@ for ac_header in mcheck.h values.h socket.h sys/socket.h  \
                  sysint.h inttypes.h termcap.h netdb.h sys/socket.h  \
                  sys/systemcfg.h ncurses.h curses.h sys/dr.h sys/vfs.h \
 		 pam/pam_appl.h security/pam_appl.h sys/sysctl.h \
+		 sys/syslog.h \
 
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -25774,6 +25776,8 @@ cat >>conftest.$ac_ext <<_ACEOF
 
   #include <stdlib.h>
   #include <openssl/rand.h>
+  #include <openssl/hmac.h>
+  #include <openssl/sha.h>
   #define SIZE 8
   int main(void)
   {
@@ -26178,7 +26182,7 @@ _ACEOF
 
 
 
-ac_config_files="$ac_config_files Makefile config.xml auxdir/Makefile contribs/Makefile contribs/perlapi/Makefile contribs/perlapi/libslurm-perl/Makefile.PL contribs/torque/Makefile src/Makefile src/api/Makefile src/common/Makefile src/sacct/Makefile src/salloc/Makefile src/sbatch/Makefile src/sattach/Makefile src/srun/Makefile src/slaunch/Makefile src/slurmd/Makefile src/slurmd/slurmd/Makefile src/slurmd/slurmstepd/Makefile src/slurmctld/Makefile src/sbcast/Makefile src/scontrol/Makefile src/scancel/Makefile src/squeue/Makefile src/sinfo/Makefile src/smap/Makefile src/strigger/Makefile src/sview/Makefile src/plugins/Makefile src/plugins/auth/Makefile src/plugins/auth/authd/Makefile src/plugins/auth/munge/Makefile src/plugins/auth/none/Makefile src/plugins/checkpoint/Makefile src/plugins/checkpoint/aix/Makefile src/plugins/checkpoint/none/Makefile src/plugins/checkpoint/ompi/Makefile src/plugins/jobacct/Makefile src/plugins/jobacct/linux/Makefile src/plugins/jobacct/aix/Makefile src/plugins/jobacct/none/Makefile src/plugins/jobcomp/Makefile src/plugins/jobcomp/filetxt/Makefile src/plugins/jobcomp/none/Makefile src/plugins/jobcomp/script/Makefile src/plugins/proctrack/Makefile src/plugins/proctrack/aix/Makefile src/plugins/proctrack/pgid/Makefile src/plugins/proctrack/linuxproc/Makefile src/plugins/proctrack/rms/Makefile src/plugins/proctrack/sgi_job/Makefile src/plugins/sched/Makefile src/plugins/sched/backfill/Makefile src/plugins/sched/builtin/Makefile src/plugins/sched/gang/Makefile src/plugins/sched/hold/Makefile src/plugins/sched/wiki/Makefile src/plugins/sched/wiki2/Makefile src/plugins/select/Makefile src/plugins/select/bluegene/Makefile src/plugins/select/bluegene/block_allocator/Makefile src/plugins/select/bluegene/plugin/Makefile src/plugins/select/linear/Makefile src/plugins/select/cons_res/Makefile src/plugins/switch/Makefile src/plugins/switch/elan/Makefile src/plugins/switch/none/Makefile src/plugins/switch/federation/Makefile src/plugins/mpi/Makefile src/plugins/mpi/mpich1_p4/Makefile src/plugins/mpi/mpich1_shmem/Makefile src/plugins/mpi/mpichgm/Makefile src/plugins/mpi/mpichmx/Makefile src/plugins/mpi/mvapich/Makefile src/plugins/mpi/lam/Makefile src/plugins/mpi/none/Makefile src/plugins/mpi/openmpi/Makefile src/plugins/task/Makefile src/plugins/task/affinity/Makefile src/plugins/task/none/Makefile doc/Makefile doc/man/Makefile doc/html/Makefile doc/html/configurator.html testsuite/Makefile testsuite/expect/Makefile testsuite/slurm_unit/Makefile testsuite/slurm_unit/common/Makefile testsuite/slurm_unit/slurmctld/Makefile testsuite/slurm_unit/slurmd/Makefile testsuite/slurm_unit/api/Makefile testsuite/slurm_unit/api/manual/Makefile"
+ac_config_files="$ac_config_files Makefile config.xml auxdir/Makefile contribs/Makefile contribs/perlapi/Makefile contribs/perlapi/libslurm-perl/Makefile.PL contribs/torque/Makefile src/Makefile src/api/Makefile src/common/Makefile src/sacct/Makefile src/salloc/Makefile src/sbatch/Makefile src/sattach/Makefile src/srun/Makefile src/slaunch/Makefile src/slurmd/Makefile src/slurmd/slurmd/Makefile src/slurmd/slurmstepd/Makefile src/slurmctld/Makefile src/sbcast/Makefile src/scontrol/Makefile src/scancel/Makefile src/squeue/Makefile src/sinfo/Makefile src/smap/Makefile src/strigger/Makefile src/sview/Makefile src/plugins/Makefile src/plugins/auth/Makefile src/plugins/auth/authd/Makefile src/plugins/auth/munge/Makefile src/plugins/auth/none/Makefile src/plugins/checkpoint/Makefile src/plugins/checkpoint/aix/Makefile src/plugins/checkpoint/none/Makefile src/plugins/checkpoint/ompi/Makefile src/plugins/jobacct/Makefile src/plugins/jobacct/linux/Makefile src/plugins/jobacct/aix/Makefile src/plugins/jobacct/none/Makefile src/plugins/jobacct/gold/Makefile src/plugins/jobcomp/Makefile src/plugins/jobcomp/filetxt/Makefile src/plugins/jobcomp/none/Makefile src/plugins/jobcomp/script/Makefile src/plugins/proctrack/Makefile src/plugins/proctrack/aix/Makefile src/plugins/proctrack/pgid/Makefile src/plugins/proctrack/linuxproc/Makefile src/plugins/proctrack/rms/Makefile src/plugins/proctrack/sgi_job/Makefile src/plugins/sched/Makefile src/plugins/sched/backfill/Makefile src/plugins/sched/builtin/Makefile src/plugins/sched/gang/Makefile src/plugins/sched/hold/Makefile src/plugins/sched/wiki/Makefile src/plugins/sched/wiki2/Makefile src/plugins/select/Makefile src/plugins/select/bluegene/Makefile src/plugins/select/bluegene/block_allocator/Makefile src/plugins/select/bluegene/plugin/Makefile src/plugins/select/linear/Makefile src/plugins/select/cons_res/Makefile src/plugins/switch/Makefile src/plugins/switch/elan/Makefile src/plugins/switch/none/Makefile src/plugins/switch/federation/Makefile src/plugins/mpi/Makefile src/plugins/mpi/mpich1_p4/Makefile src/plugins/mpi/mpich1_shmem/Makefile src/plugins/mpi/mpichgm/Makefile src/plugins/mpi/mpichmx/Makefile src/plugins/mpi/mvapich/Makefile src/plugins/mpi/lam/Makefile src/plugins/mpi/none/Makefile src/plugins/mpi/openmpi/Makefile src/plugins/task/Makefile src/plugins/task/affinity/Makefile src/plugins/task/none/Makefile doc/Makefile doc/man/Makefile doc/html/Makefile doc/html/configurator.html testsuite/Makefile testsuite/expect/Makefile testsuite/slurm_unit/Makefile testsuite/slurm_unit/common/Makefile testsuite/slurm_unit/slurmctld/Makefile testsuite/slurm_unit/slurmd/Makefile testsuite/slurm_unit/api/Makefile testsuite/slurm_unit/api/manual/Makefile"
 
 
 cat >confcache <<\_ACEOF
@@ -26928,6 +26932,7 @@ do
     "src/plugins/jobacct/linux/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/jobacct/linux/Makefile" ;;
     "src/plugins/jobacct/aix/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/jobacct/aix/Makefile" ;;
     "src/plugins/jobacct/none/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/jobacct/none/Makefile" ;;
+    "src/plugins/jobacct/gold/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/jobacct/gold/Makefile" ;;
     "src/plugins/jobcomp/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/jobcomp/Makefile" ;;
     "src/plugins/jobcomp/filetxt/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/jobcomp/filetxt/Makefile" ;;
     "src/plugins/jobcomp/none/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/jobcomp/none/Makefile" ;;
diff --git a/configure.ac b/configure.ac
index 0ab97b818aff4ca9b1bd4e27b786acfe954252e2..e452a5336961f157a4822682dd62897415b082b1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-# $Id: configure.ac 12592 2007-10-31 21:12:49Z jette $
+# $Id: configure.ac 12827 2007-12-14 22:29:30Z da $
 # This file is to be processed with autoconf to generate a configure script
 
 dnl Prologue
@@ -60,6 +60,7 @@ AC_CHECK_HEADERS(mcheck.h values.h socket.h sys/socket.h  \
                  sysint.h inttypes.h termcap.h netdb.h sys/socket.h  \
                  sys/systemcfg.h ncurses.h curses.h sys/dr.h sys/vfs.h \
 		 pam/pam_appl.h security/pam_appl.h sys/sysctl.h \
+		 sys/syslog.h \
 		)
 AC_HEADER_SYS_WAIT
 AC_HEADER_TIME
@@ -295,6 +296,7 @@ AC_CONFIG_FILES([Makefile
 		 src/plugins/jobacct/linux/Makefile
 		 src/plugins/jobacct/aix/Makefile
 		 src/plugins/jobacct/none/Makefile
+		 src/plugins/jobacct/gold/Makefile
 		 src/plugins/jobcomp/Makefile
 		 src/plugins/jobcomp/filetxt/Makefile
 		 src/plugins/jobcomp/none/Makefile
diff --git a/contribs/perlapi/Makefile.am b/contribs/perlapi/Makefile.am
index 00939f2da34a360cb84f68744c957a1b788f610b..6cbdfb13271e24e3313b24c79481fe0119bacf8a 100644
--- a/contribs/perlapi/Makefile.am
+++ b/contribs/perlapi/Makefile.am
@@ -24,7 +24,7 @@ $(perl_dir)/Makefile:	$(perl_dir)/Makefile.PL
 			${LN_S} -f ../${srcdir}/$$f $$f; \
 		done; \
 	fi
-	@cd $(perl_dir) && $(perlpath) Makefile.PL $(PERL_MM_PARAMS) prefix=${prefix}
+	@cd $(perl_dir) && $(perlpath) Makefile.PL $(PERL_MM_PARAMS) prefix=${prefix} INSTALLDIRS=perl LIB=@libdir@/perl5 installman1dir=@mandir@/man1 installman3dir=@mandir@/man3
 
 #
 # Note on linking logic below
@@ -39,7 +39,7 @@ all-local: $(perl_dir)/Makefile #libslurm
 if HAVE_AIX
 	@cd $(perl_dir) && \
 	if [ ! -f Makefile ]; then \
-		$(perlpath) Makefile.PL $(PERL_MM_PARAMS) prefix=${prefix}; \
+		$(perlpath) Makefile.PL $(PERL_MM_PARAMS) prefix=${prefix} INSTALLDIRS=perl LIB=@libdir@/perl5 installman1dir=@mandir@/man1 installman3dir=@mandir@/man3; \
 	fi && \
 	($(MAKE) CC="$(CC)" CCFLAGS="$(PERL_CFLAGS) -g -static $(CFLAGS)" $(PERL_EXTRA_OPTS) || \
 	 $(MAKE) CC="$(CC)" CCFLAGS="$(PERL_CFLAGS) -g -static $(CFLAGS)" $(PERL_EXTRA_OPTS)) && \
@@ -47,7 +47,7 @@ if HAVE_AIX
 else
 	@cd $(perl_dir) && \
 	if [ ! -f Makefile ]; then \
-		$(perlpath) Makefile.PL $(PERL_MM_PARAMS) prefix=${prefix}; \
+		$(perlpath) Makefile.PL $(PERL_MM_PARAMS) prefix=${prefix} INSTALLDIRS=perl LIB=@libdir@/perl5 installman1dir=@mandir@/man1 installman3dir=@mandir@/man3; \
 	fi && \
 	($(MAKE) CC="$(CC)" LD="$(CC) $(CFLAGS)" CCFLAGS="$(PERL_CFLAGS) -g -static $(CFLAGS)" $(PERL_EXTRA_OPTS) || \
 	 $(MAKE) CC="$(CC)" LD="$(CC) $(CFLAGS)" CCFLAGS="$(PERL_CFLAGS) -g -static $(CFLAGS)" $(PERL_EXTRA_OPTS)) && \
diff --git a/contribs/perlapi/Makefile.in b/contribs/perlapi/Makefile.in
index c11e027f830e6ff47d4f46d9121a28d0867d9496..fe82cbd59373c029e19308711a469b01e6277df2 100644
--- a/contribs/perlapi/Makefile.in
+++ b/contribs/perlapi/Makefile.in
@@ -416,7 +416,7 @@ $(perl_dir)/Makefile:	$(perl_dir)/Makefile.PL
 			${LN_S} -f ../${srcdir}/$$f $$f; \
 		done; \
 	fi
-	@cd $(perl_dir) && $(perlpath) Makefile.PL $(PERL_MM_PARAMS) prefix=${prefix}
+	@cd $(perl_dir) && $(perlpath) Makefile.PL $(PERL_MM_PARAMS) prefix=${prefix} INSTALLDIRS=perl LIB=@libdir@/perl5 installman1dir=@mandir@/man1 installman3dir=@mandir@/man3
 
 #
 # Note on linking logic below
@@ -430,14 +430,14 @@ $(perl_dir)/Makefile:	$(perl_dir)/Makefile.PL
 all-local: $(perl_dir)/Makefile #libslurm
 @HAVE_AIX_TRUE@	@cd $(perl_dir) && \
 @HAVE_AIX_TRUE@	if [ ! -f Makefile ]; then \
-@HAVE_AIX_TRUE@		$(perlpath) Makefile.PL $(PERL_MM_PARAMS) prefix=${prefix}; \
+@HAVE_AIX_TRUE@		$(perlpath) Makefile.PL $(PERL_MM_PARAMS) prefix=${prefix} INSTALLDIRS=perl LIB=@libdir@/perl5 installman1dir=@mandir@/man1 installman3dir=@mandir@/man3; \
 @HAVE_AIX_TRUE@	fi && \
 @HAVE_AIX_TRUE@	($(MAKE) CC="$(CC)" CCFLAGS="$(PERL_CFLAGS) -g -static $(CFLAGS)" $(PERL_EXTRA_OPTS) || \
 @HAVE_AIX_TRUE@	 $(MAKE) CC="$(CC)" CCFLAGS="$(PERL_CFLAGS) -g -static $(CFLAGS)" $(PERL_EXTRA_OPTS)) && \
 @HAVE_AIX_TRUE@	cd ..;
 @HAVE_AIX_FALSE@	@cd $(perl_dir) && \
 @HAVE_AIX_FALSE@	if [ ! -f Makefile ]; then \
-@HAVE_AIX_FALSE@		$(perlpath) Makefile.PL $(PERL_MM_PARAMS) prefix=${prefix}; \
+@HAVE_AIX_FALSE@		$(perlpath) Makefile.PL $(PERL_MM_PARAMS) prefix=${prefix} INSTALLDIRS=perl LIB=@libdir@/perl5 installman1dir=@mandir@/man1 installman3dir=@mandir@/man3; \
 @HAVE_AIX_FALSE@	fi && \
 @HAVE_AIX_FALSE@	($(MAKE) CC="$(CC)" LD="$(CC) $(CFLAGS)" CCFLAGS="$(PERL_CFLAGS) -g -static $(CFLAGS)" $(PERL_EXTRA_OPTS) || \
 @HAVE_AIX_FALSE@	 $(MAKE) CC="$(CC)" LD="$(CC) $(CFLAGS)" CCFLAGS="$(PERL_CFLAGS) -g -static $(CFLAGS)" $(PERL_EXTRA_OPTS)) && \
diff --git a/contribs/perlapi/libslurm-perl/Makefile.PL.in b/contribs/perlapi/libslurm-perl/Makefile.PL.in
index 0a8985101ce1c73047fbbe18b6b194c76f95059d..3b7c60ea31a200faa5ff30b1a2d35cdce1db351d 100644
--- a/contribs/perlapi/libslurm-perl/Makefile.PL.in
+++ b/contribs/perlapi/libslurm-perl/Makefile.PL.in
@@ -77,8 +77,8 @@ DESTDIR_BUG
 # AIX has problems with not always having the correct
 # flags so we have to add some :)
 my $os = lc(`uname`);
-my $other_ld_flags = "";
-$other_ld_flags = "-brtl -G -bnoentry -bgcbypass:1000 -bexpfull"
+my $other_ld_flags = "-Wl,-rpath,@top_builddir@/src/api/.libs -Wl,-rpath,@prefix@/lib";
+$other_ld_flags = " -brtl -G -bnoentry -bgcbypass:1000 -bexpfull"
 	if $os =~ "aix";
 
 WriteMakefile(
diff --git a/contribs/torque/Makefile.am b/contribs/torque/Makefile.am
index 09311ac730e099bac17e7a7fbdc6f89c6f1cde5a..16c02e0fcf22c7d8272ce7fc3066ac078c109413 100644
--- a/contribs/torque/Makefile.am
+++ b/contribs/torque/Makefile.am
@@ -17,8 +17,9 @@ install-binSCRIPTS: $(bin_SCRIPTS)
 	@$(NORMAL_INSTALL)
 	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
 	@list='$(bin_SCRIPTS)'; for p in $$list; do \
-	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binSCRIPT_INSTALL) '$(top_srcdir)/contribs/torque/$$p.pl' '$(DESTDIR)$(bindir)/$$p'"; \
-	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binSCRIPT_INSTALL) "$(top_srcdir)/contribs/torque/$$p.pl" "$(DESTDIR)$(bindir)/$$p" || exit 1; \
+	   echo "sed 's%use lib .*%use lib qw(${exec_prefix}/lib ${exec_prefix}/lib/perl5);%' $(top_srcdir)/contribs/torque/$$p.pl > $(DESTDIR)$(bindir)/$$p"; \
+	   sed 's%use lib .*%use lib qw(@libdir@ @libdir@/perl5);%' $(top_srcdir)/contribs/torque/$$p.pl >$(DESTDIR)$(bindir)/$$p; \
+	   chmod 755 $(DESTDIR)$(bindir)/$$p;\
 	done
 
 uninstall-binSCRIPTS:
diff --git a/contribs/torque/Makefile.in b/contribs/torque/Makefile.in
index 8446e6f0e1d4a1ece2ff9d719202401ae98950c9..9b3c84c0ca06072396c9ccaafedc04b824111fde 100644
--- a/contribs/torque/Makefile.in
+++ b/contribs/torque/Makefile.in
@@ -410,8 +410,9 @@ install-binSCRIPTS: $(bin_SCRIPTS)
 	@$(NORMAL_INSTALL)
 	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
 	@list='$(bin_SCRIPTS)'; for p in $$list; do \
-	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binSCRIPT_INSTALL) '$(top_srcdir)/contribs/torque/$$p.pl' '$(DESTDIR)$(bindir)/$$p'"; \
-	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binSCRIPT_INSTALL) "$(top_srcdir)/contribs/torque/$$p.pl" "$(DESTDIR)$(bindir)/$$p" || exit 1; \
+	   echo "sed 's%use lib .*%use lib qw(${exec_prefix}/lib ${exec_prefix}/lib/perl5);%' $(top_srcdir)/contribs/torque/$$p.pl > $(DESTDIR)$(bindir)/$$p"; \
+	   sed 's%use lib .*%use lib qw(@libdir@ @libdir@/perl5);%' $(top_srcdir)/contribs/torque/$$p.pl >$(DESTDIR)$(bindir)/$$p; \
+	   chmod 755 $(DESTDIR)$(bindir)/$$p;\
 	done
 
 uninstall-binSCRIPTS:
diff --git a/contribs/torque/qstat.pl b/contribs/torque/qstat.pl
index 5a8ae0fd736fdf751b9afe442903934a56af854f..8b53967f459f2aee79dcfab77abec66f320f98ac 100755
--- a/contribs/torque/qstat.pl
+++ b/contribs/torque/qstat.pl
@@ -343,7 +343,7 @@ sub job_time_used
 
 	if (($job->{'job_state'} == JOB_RUNNING)
 	    ||  ($job->{'end_time'} == 0)) {
-		$end_time = localtime;
+		$end_time = time;
 	} else {
 		$end_time = $job->{'end_time'};
 	}
diff --git a/doc/man/man1/sacct.1 b/doc/man/man1/sacct.1
index e4f58eaa96b7e8f9a9b10c8a9cff23e64f272d6d..a441a1dd833fd3d2878c10e0a1ef70262bd99b04 100644
--- a/doc/man/man1/sacct.1
+++ b/doc/man/man1/sacct.1
@@ -1143,7 +1143,7 @@ Jobid        Ncpus  Ntasks  Nsignals Status
 Copyright (C) 2005\-2007 Copyright Hewlett\-Packard Development Company L.P.
 .LP
 This file is part of SLURM, a resource management program.
-For details, see <http://www.llnl.gov/linux/slurm/>.
+For details, see <https://computing.llnl.gov/linux/slurm/>.
 .LP
 SLURM is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
diff --git a/doc/man/man1/salloc.1 b/doc/man/man1/salloc.1
index 3fe996045934959cae130c86a170e777dc7a56a1..fd07da0bd1684fc74dd2f98ba83e786d5609873e 100644
--- a/doc/man/man1/salloc.1
+++ b/doc/man/man1/salloc.1
@@ -472,7 +472,7 @@ Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 UCRL\-CODE\-226842.
 .LP
 This file is part of SLURM, a resource management program.
-For details, see <http://www.llnl.gov/linux/slurm/>.
+For details, see <https://computing.llnl.gov/linux/slurm/>.
 .LP
 SLURM is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
diff --git a/doc/man/man1/sattach.1 b/doc/man/man1/sattach.1
index bf7d9a8e2a9d888591f4f37d7a09d0de8b34f27f..3c8464da7f7e69221be50ba1a2d92d18889a91a3 100644
--- a/doc/man/man1/sattach.1
+++ b/doc/man/man1/sattach.1
@@ -72,7 +72,7 @@ Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 UCRL\-CODE\-226842.
 .LP
 This file is part of SLURM, a resource management program.
-For details, see <http://www.llnl.gov/linux/slurm/>.
+For details, see <https://computing.llnl.gov/linux/slurm/>.
 .LP
 SLURM is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
diff --git a/doc/man/man1/sbatch.1 b/doc/man/man1/sbatch.1
index e317a291817843db5fc868272c1750d92fd97f11..08b034a81f741a3dd190ced7784b9eb237c6ca92 100644
--- a/doc/man/man1/sbatch.1
+++ b/doc/man/man1/sbatch.1
@@ -309,6 +309,50 @@ Request a specific partition for the resource allocation.  If not specified, the
 default behaviour is to allow the slurm controller to select the default
 partition as designated by the system administrator.
 
+.TP
+\fB\-\-propagate\fR[=\fIrlimits\fR]
+Allows users to specify which of the modifiable (soft) resource limits
+to propagate to the compute nodes and apply to their jobs.  If
+\fIrlimits\fR is not specified, then all resource limits will be
+propagated.
+The following rlimit names are supported by Slurm (although some
+options may not be supported on some systems):
+.RS
+.TP 10
+\fBALL\fR
+All limits listed below
+.TP
+\fBAS\fR
+The maximum address space for a processes
+.TP
+\fBCORE\fR
+The maximum size of core file
+.TP
+\fBCPU\fR
+The maximum amount of CPU time
+.TP
+\fBDATA\fR
+The maximum size of a process's data segment
+.TP
+\fBFSIZE\fR
+The maximum size of files created
+.TP
+\fBMEMLOCK\fR
+The maximum size that may be locked into memory
+.TP
+\fBNOFILE\fR
+The maximum number of open files
+.TP
+\fBNPROC\fR
+The maximum number of processes available
+.TP
+\fBRSS\fR
+The maximum resident set size
+.TP
+\fBSTACK\fR
+The maximum stack size
+.RE
+
 .TP
 \fB\-q\fR, \fB\-\-quiet\fR
 Suppress informational messages from sbatch. Errors will still be displayed.
@@ -592,7 +636,7 @@ Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 UCRL\-CODE\-226842.
 .LP
 This file is part of SLURM, a resource management program.
-For details, see <http://www.llnl.gov/linux/slurm/>.
+For details, see <https://computing.llnl.gov/linux/slurm/>.
 .LP
 SLURM is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
diff --git a/doc/man/man1/sbcast.1 b/doc/man/man1/sbcast.1
index 64bb43c47e0685227b83a73e3896101e30e83751..acd4cf5583009a18d681ff4c5618d7c40e57fa5b 100644
--- a/doc/man/man1/sbcast.1
+++ b/doc/man/man1/sbcast.1
@@ -93,7 +93,7 @@ Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 UCRL\-CODE\-226842.
 .LP
 This file is part of SLURM, a resource management program.
-For details, see <http://www.llnl.gov/linux/slurm/>.
+For details, see <https://computing.llnl.gov/linux/slurm/>.
 .LP
 SLURM is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
diff --git a/doc/man/man1/scancel.1 b/doc/man/man1/scancel.1
index 8943d5cb5c80742865cd5308da158e91caf462d6..28ba0d031e0f06b9070dae1d31297f2f08b3ca2b 100644
--- a/doc/man/man1/scancel.1
+++ b/doc/man/man1/scancel.1
@@ -156,7 +156,7 @@ Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 UCRL\-CODE\-226842.
 .LP
 This file is part of SLURM, a resource management program.
-For details, see <http://www.llnl.gov/linux/slurm/>.
+For details, see <https://computing.llnl.gov/linux/slurm/>.
 .LP
 SLURM is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
diff --git a/doc/man/man1/scontrol.1 b/doc/man/man1/scontrol.1
index 74ad6370fa2ce841af14ff2a4bae12553a76b49f..9c6c4a7def4de0dc6af8977b394ff71531d48b16 100644
--- a/doc/man/man1/scontrol.1
+++ b/doc/man/man1/scontrol.1
@@ -542,7 +542,7 @@ Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 UCRL\-CODE\-226842.
 .LP
 This file is part of SLURM, a resource management program.
-For details, see <http://www.llnl.gov/linux/slurm/>.
+For details, see <https://computing.llnl.gov/linux/slurm/>.
 .LP
 SLURM is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
diff --git a/doc/man/man1/sinfo.1 b/doc/man/man1/sinfo.1
index 5cde7d1b5c858847d97dbc9fb57fd55f4d713401..03af1c5aa1b734923bb5eeb26bf85c536aa08a14 100644
--- a/doc/man/man1/sinfo.1
+++ b/doc/man/man1/sinfo.1
@@ -498,7 +498,7 @@ Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 UCRL\-CODE\-226842.
 .LP
 This file is part of SLURM, a resource management program.
-For details, see <http://www.llnl.gov/linux/slurm/>.
+For details, see <https://computing.llnl.gov/linux/slurm/>.
 .LP
 SLURM is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
diff --git a/doc/man/man1/slaunch.1 b/doc/man/man1/slaunch.1
index a8c9b002015aa445588ab21961a3a357f0e111d4..8231772004351daf261d92d62082b4503a22f580 100644
--- a/doc/man/man1/slaunch.1
+++ b/doc/man/man1/slaunch.1
@@ -1,4 +1,4 @@
-.\" $Id: slaunch.1 11918 2007-08-01 17:50:30Z jette $
+.\" $Id: slaunch.1 12842 2007-12-17 19:33:54Z jette $
 .TH "slaunch" "1" "SLURM 1.2" "October 2006" "SLURM Commands"
 .SH "NAME"
 .LP 
@@ -270,8 +270,8 @@ The options include a number representing the size of the task block.
 This is followed by an optional specification of the task distribution
 scheme within a block of tasks and between the blocks of tasks.
 For more details (including examples and diagrams), please see
-http://www.llnl.gov/linux/slurm/mc_support.html and
-http://www.llnl.gov/linux/slurm/dist_plane.html.
+https://computing.llnl.gov/linux/slurm/mc_support.html and
+https://computing.llnl.gov/linux/slurm/dist_plane.html.
 .TP
 .B hostfile
 The hostfile method of distribution will allocate processes in\-order as
@@ -713,7 +713,7 @@ Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 UCRL\-CODE\-226842.
 .LP
 This file is part of SLURM, a resource management program.
-For details, see <http://www.llnl.gov/linux/slurm/>.
+For details, see <https://computing.llnl.gov/linux/slurm/>.
 .LP
 SLURM is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
diff --git a/doc/man/man1/slurm.1 b/doc/man/man1/slurm.1
index fcaa43e1a9413298f721f53d782a54dbc559a1e7..096f029a75810a132db90af3cb0a75f275638310 100644
--- a/doc/man/man1/slurm.1
+++ b/doc/man/man1/slurm.1
@@ -32,7 +32,7 @@ SLURM configuration is maintained in the \fBslurm.conf\fR file.
 Man pages are available for all SLURM commands, daemons, APIs, plus the 
 \fBslurm.conf\fR file.
 Extensive documenation is also available on the internet at
-\fB<http://www.llnl.gov/linux/slurm/>\fR.
+\fB<https://computing.llnl.gov/linux/slurm/>\fR.
 
 .SH "COPYING"
 Copyright (C) 2005\-2007 The Regents of the University of California.
@@ -40,7 +40,7 @@ Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 UCRL\-CODE\-226842.
 .LP
 This file is part of SLURM, a resource management program.
-For details, see <http://www.llnl.gov/linux/slurm/>.
+For details, see <https://computing.llnl.gov/linux/slurm/>.
 .LP
 SLURM is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
diff --git a/doc/man/man1/smap.1 b/doc/man/man1/smap.1
index 85bfbd9ae484722cf979d930dbec7071f7dae871..a077063eaf2bcf388015470993fd93d17825c901 100644
--- a/doc/man/man1/smap.1
+++ b/doc/man/man1/smap.1
@@ -424,7 +424,7 @@ Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 UCRL\-CODE\-226842.
 .LP
 This file is part of SLURM, a resource management program.
-For details, see <http://www.llnl.gov/linux/slurm/>.
+For details, see <https://computing.llnl.gov/linux/slurm/>.
 .LP
 SLURM is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
diff --git a/doc/man/man1/squeue.1 b/doc/man/man1/squeue.1
index 405bd1c36293233de89b5d5fa9d26dbe81349fef..b8f887ee8219a91b6714d5fd1ae5a1f0dd8bfd7b 100644
--- a/doc/man/man1/squeue.1
+++ b/doc/man/man1/squeue.1
@@ -474,7 +474,7 @@ Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 UCRL\-CODE\-226842.
 .LP
 This file is part of SLURM, a resource management program.
-For details, see <http://www.llnl.gov/linux/slurm/>.
+For details, see <https://computing.llnl.gov/linux/slurm/>.
 .LP
 SLURM is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
diff --git a/doc/man/man1/srun.1 b/doc/man/man1/srun.1
index c2ab45e664d27cd6840c0ae8dbb32d77ec125938..54eb34120a23b321c39755dcbc8c2db5bc518ba9 100644
--- a/doc/man/man1/srun.1
+++ b/doc/man/man1/srun.1
@@ -1,4 +1,4 @@
-\." $Id: srun.1 12697 2007-11-27 22:02:29Z jette $
+\." $Id: srun.1 12842 2007-12-17 19:33:54Z jette $
 .\"
 .TH SRUN "1" "July 2007" "srun 1.2" "slurm components"
 
@@ -424,8 +424,8 @@ The options include a number representing the size of the task block.
 This is followed by an optional specification of the task distribution 
 scheme within a block of tasks and between the blocks of tasks.
 For more details (including examples and diagrams), please see
-http://www.llnl.gov/linux/slurm/mc_support.html and
-http://www.llnl.gov/linux/slurm/dist_plane.html.
+https://computing.llnl.gov/linux/slurm/mc_support.html and
+https://computing.llnl.gov/linux/slurm/dist_plane.html.
 .TP
 .B arbitrary
 The arbitrary method of distribution will allocate processes in\-order as 
@@ -1471,7 +1471,7 @@ These tasks initiated outside of SLURM's monitoring
 or control. SLURM's epilog should be configured to purge
 these tasks when the job's allocation is relinquished.
 
-See \fIhttp://www.linux.gov/linux/slurm/quickstart.html#mpi\fR 
+See \fIhttps://computing.linux.gov/linux/slurm/quickstart.html#mpi\fR 
 for more information on use of these various MPI implementation 
 with SLURM.
 
@@ -1683,7 +1683,7 @@ Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 UCRL\-CODE\-226842.
 .LP
 This file is part of SLURM, a resource management program.
-For details, see <http://www.llnl.gov/linux/slurm/>.
+For details, see <https://computing.llnl.gov/linux/slurm/>.
 .LP
 SLURM is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
diff --git a/doc/man/man1/strigger.1 b/doc/man/man1/strigger.1
index 8494fbe7944afdc02d0ed36f57cf6912edf8eb1c..82de9dfbbfa84115017f2f8a6b3f3ce5cd0738aa 100644
--- a/doc/man/man1/strigger.1
+++ b/doc/man/man1/strigger.1
@@ -249,7 +249,7 @@ Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 UCRL\-CODE\-226842.
 .LP
 This file is part of SLURM, a resource management program.
-For details, see <http://www.llnl.gov/linux/slurm/>.
+For details, see <https://computing.llnl.gov/linux/slurm/>.
 .LP
 SLURM is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
diff --git a/doc/man/man1/sview.1 b/doc/man/man1/sview.1
index 1bd2db590de3962632c3a2a4028dd57475031535..ecbe0fc5281adde840483accab995f12b749cabe 100644
--- a/doc/man/man1/sview.1
+++ b/doc/man/man1/sview.1
@@ -52,7 +52,7 @@ Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 UCRL\-CODE\-226842.
 .LP
 This file is part of SLURM, a resource management program.
-For details, see <http://www.llnl.gov/linux/slurm/>.
+For details, see <https://computing.llnl.gov/linux/slurm/>.
 .LP
 SLURM is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
diff --git a/doc/man/man3/slurm_allocate_resources.3 b/doc/man/man3/slurm_allocate_resources.3
index 6fd25287340ef36f4d309a754a8445c3007018e5..1c143f701b19a3733d02354f5ee14886b2e542b4 100644
--- a/doc/man/man3/slurm_allocate_resources.3
+++ b/doc/man/man3/slurm_allocate_resources.3
@@ -261,7 +261,7 @@ Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 UCRL\-CODE\-226842.
 .LP
 This file is part of SLURM, a resource management program.
-For details, see <http://www.llnl.gov/linux/slurm/>.
+For details, see <https://computing.llnl.gov/linux/slurm/>.
 .LP
 SLURM is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
diff --git a/doc/man/man3/slurm_checkpoint_error.3 b/doc/man/man3/slurm_checkpoint_error.3
index 7d332374ec91220b5c7ff68157e42ffe73a806f5..fe98352bb2e3ffb05d45c9342dac9aaf8882ff5a 100644
--- a/doc/man/man3/slurm_checkpoint_error.3
+++ b/doc/man/man3/slurm_checkpoint_error.3
@@ -222,7 +222,7 @@ Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 UCRL\-CODE\-226842.
 .LP
 This file is part of SLURM, a resource management program.
-For details, see <http://www.llnl.gov/linux/slurm/>.
+For details, see <https://computing.llnl.gov/linux/slurm/>.
 .LP
 SLURM is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
diff --git a/doc/man/man3/slurm_complete_job.3 b/doc/man/man3/slurm_complete_job.3
index 9a22e33fa9dc321797e3d9b44f107c2760d82cd6..41e045769616b7e9fdbae4197e153436c20345b1 100644
--- a/doc/man/man3/slurm_complete_job.3
+++ b/doc/man/man3/slurm_complete_job.3
@@ -78,7 +78,7 @@ Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 UCRL\-CODE\-226842.
 .LP
 This file is part of SLURM, a resource management program.
-For details, see <http://www.llnl.gov/linux/slurm/>.
+For details, see <https://computing.llnl.gov/linux/slurm/>.
 .LP
 SLURM is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
diff --git a/doc/man/man3/slurm_free_ctl_conf.3 b/doc/man/man3/slurm_free_ctl_conf.3
index 31de91701a7a2af5dd50a5630193cc38b1ebf833..0c32f5b05235001aeec2334922a63a431a3b5e13 100644
--- a/doc/man/man3/slurm_free_ctl_conf.3
+++ b/doc/man/man3/slurm_free_ctl_conf.3
@@ -151,7 +151,7 @@ Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 UCRL\-CODE\-226842.
 .LP
 This file is part of SLURM, a resource management program.
-For details, see <http://www.llnl.gov/linux/slurm/>.
+For details, see <https://computing.llnl.gov/linux/slurm/>.
 .LP
 SLURM is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
diff --git a/doc/man/man3/slurm_free_job_info_msg.3 b/doc/man/man3/slurm_free_job_info_msg.3
index c04db73aa3533aa332323feedd52187eccb09143..c4e4cb6449b876f92a93dcda7a5a311b1608a72a 100644
--- a/doc/man/man3/slurm_free_job_info_msg.3
+++ b/doc/man/man3/slurm_free_job_info_msg.3
@@ -335,7 +335,7 @@ Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 UCRL\-CODE\-226842.
 .LP
 This file is part of SLURM, a resource management program.
-For details, see <http://www.llnl.gov/linux/slurm/>.
+For details, see <https://computing.llnl.gov/linux/slurm/>.
 .LP
 SLURM is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
diff --git a/doc/man/man3/slurm_free_job_step_info_response_msg.3 b/doc/man/man3/slurm_free_job_step_info_response_msg.3
index 2aa39fa2f33e8722a676f7867f62739452bbaf97..c692a015370b85c17a342939723b63bea41e6d8d 100644
--- a/doc/man/man3/slurm_free_job_step_info_response_msg.3
+++ b/doc/man/man3/slurm_free_job_step_info_response_msg.3
@@ -207,7 +207,7 @@ Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 UCRL\-CODE\-226842.
 .LP
 This file is part of SLURM, a resource management program.
-For details, see <http://www.llnl.gov/linux/slurm/>.
+For details, see <https://computing.llnl.gov/linux/slurm/>.
 .LP
 SLURM is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
diff --git a/doc/man/man3/slurm_free_node_info.3 b/doc/man/man3/slurm_free_node_info.3
index 8419469e5cffcf9bd495bebf6a1901ed339bd416..f94fe37f94e159d6283ed7167940113195b7f5dd 100644
--- a/doc/man/man3/slurm_free_node_info.3
+++ b/doc/man/man3/slurm_free_node_info.3
@@ -244,7 +244,7 @@ Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 UCRL\-CODE\-226842.
 .LP
 This file is part of SLURM, a resource management program.
-For details, see <http://www.llnl.gov/linux/slurm/>.
+For details, see <https://computing.llnl.gov/linux/slurm/>.
 .LP
 SLURM is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
diff --git a/doc/man/man3/slurm_free_partition_info.3 b/doc/man/man3/slurm_free_partition_info.3
index 85d2ccf7d05435bdc6a1f260c9b743b42f4a5353..dee723fe2808a776bd35f96be34a4206b833cc6c 100644
--- a/doc/man/man3/slurm_free_partition_info.3
+++ b/doc/man/man3/slurm_free_partition_info.3
@@ -192,7 +192,7 @@ Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 UCRL\-CODE\-226842.
 .LP
 This file is part of SLURM, a resource management program.
-For details, see <http://www.llnl.gov/linux/slurm/>.
+For details, see <https://computing.llnl.gov/linux/slurm/>.
 .LP
 SLURM is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
diff --git a/doc/man/man3/slurm_get_errno.3 b/doc/man/man3/slurm_get_errno.3
index 7eb8d0ae0a0809ee3dc4876b62ea47dc3729172d..84b8c008b0dc507c761d43f6010041c696c54c25 100644
--- a/doc/man/man3/slurm_get_errno.3
+++ b/doc/man/man3/slurm_get_errno.3
@@ -77,7 +77,7 @@ Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 UCRL\-CODE\-226842.
 .LP
 This file is part of SLURM, a resource management program.
-For details, see <http://www.llnl.gov/linux/slurm/>.
+For details, see <https://computing.llnl.gov/linux/slurm/>.
 .LP
 SLURM is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
diff --git a/doc/man/man3/slurm_hostlist_create.3 b/doc/man/man3/slurm_hostlist_create.3
index 50a0d8673f17a743cf0538589c400419397a2bdb..1f9cea53d0e9f1fc8a6af667c57a61f1f23dd4d4 100644
--- a/doc/man/man3/slurm_hostlist_create.3
+++ b/doc/man/man3/slurm_hostlist_create.3
@@ -111,7 +111,7 @@ Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 UCRL\-CODE\-226842.
 .LP
 This file is part of SLURM, a resource management program.
-For details, see <http://www.llnl.gov/linux/slurm/>.
+For details, see <https://computing.llnl.gov/linux/slurm/>.
 .LP
 SLURM is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
diff --git a/doc/man/man3/slurm_job_step_create.3 b/doc/man/man3/slurm_job_step_create.3
index 026b9596835219c56f563223ed86e1707b4f1fe0..22fec53ab7ee7d78e5294be92553dfc56a86693a 100644
--- a/doc/man/man3/slurm_job_step_create.3
+++ b/doc/man/man3/slurm_job_step_create.3
@@ -78,7 +78,7 @@ Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 UCRL\-CODE\-226842.
 .LP
 This file is part of SLURM, a resource management program.
-For details, see <http://www.llnl.gov/linux/slurm/>.
+For details, see <https://computing.llnl.gov/linux/slurm/>.
 .LP
 SLURM is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
diff --git a/doc/man/man3/slurm_kill_job.3 b/doc/man/man3/slurm_kill_job.3
index 57908ce19fe6ae3e5038edd402e03d4e5daed10e..c3e827a9a23038f9acc74d3d5b3b3dbfa90d72c5 100644
--- a/doc/man/man3/slurm_kill_job.3
+++ b/doc/man/man3/slurm_kill_job.3
@@ -80,7 +80,7 @@ Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 UCRL\-CODE\-226842.
 .LP
 This file is part of SLURM, a resource management program.
-For details, see <http://www.llnl.gov/linux/slurm/>.
+For details, see <https://computing.llnl.gov/linux/slurm/>.
 .LP
 SLURM is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
diff --git a/doc/man/man3/slurm_reconfigure.3 b/doc/man/man3/slurm_reconfigure.3
index 21856df4b18fc8294de4f9fab23523ff574791cd..769bddfd15d52570e95a6e68a4304185aa2830b1 100644
--- a/doc/man/man3/slurm_reconfigure.3
+++ b/doc/man/man3/slurm_reconfigure.3
@@ -247,7 +247,7 @@ Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 UCRL\-CODE\-226842.
 .LP
 This file is part of SLURM, a resource management program.
-For details, see <http://www.llnl.gov/linux/slurm/>.
+For details, see <https://computing.llnl.gov/linux/slurm/>.
 .LP
 SLURM is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
diff --git a/doc/man/man3/slurm_resume.3 b/doc/man/man3/slurm_resume.3
index 13ad3b9a7f7cb5985df8d6424020ba9386bf5fcf..9dc6729eead5bc36a5c09863dd8ff07bdf6b6943 100644
--- a/doc/man/man3/slurm_resume.3
+++ b/doc/man/man3/slurm_resume.3
@@ -78,7 +78,7 @@ Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 UCRL\-CODE\-226842.
 .LP
 This file is part of SLURM, a resource management program.
-For details, see <http://www.llnl.gov/linux/slurm/>.
+For details, see <https://computing.llnl.gov/linux/slurm/>.
 .LP
 SLURM is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
diff --git a/doc/man/man3/slurm_step_ctx_create.3 b/doc/man/man3/slurm_step_ctx_create.3
index a56be2b1ce850cdb0ad2b904b5351ebe617722a6..ac62538fa297440833287fceedd897b05ef38f24 100644
--- a/doc/man/man3/slurm_step_ctx_create.3
+++ b/doc/man/man3/slurm_step_ctx_create.3
@@ -207,7 +207,7 @@ Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 UCRL\-CODE\-226842.
 .LP
 This file is part of SLURM, a resource management program.
-For details, see <http://www.llnl.gov/linux/slurm/>.
+For details, see <https://computing.llnl.gov/linux/slurm/>.
 .LP
 SLURM is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
diff --git a/doc/man/man3/slurm_step_launch.3 b/doc/man/man3/slurm_step_launch.3
index b8307d593ffacb73790755679370eee227473890..70f27685dbf81d66c21893af6257480d187c41d1 100644
--- a/doc/man/man3/slurm_step_launch.3
+++ b/doc/man/man3/slurm_step_launch.3
@@ -186,7 +186,7 @@ Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 UCRL\-CODE\-226842.
 .LP
 This file is part of SLURM, a resource management program.
-For details, see <http://www.llnl.gov/linux/slurm/>.
+For details, see <https://computing.llnl.gov/linux/slurm/>.
 .LP
 SLURM is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
diff --git a/doc/man/man5/bluegene.conf.5 b/doc/man/man5/bluegene.conf.5
index 5e0c1df34af0d5544ef346a19988bbeb578a1f64..a059f07b561d41c69818eb11cb80b1701e35be2d 100644
--- a/doc/man/man5/bluegene.conf.5
+++ b/doc/man/man5/bluegene.conf.5
@@ -220,7 +220,7 @@ Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 UCRL\-CODE\-226842.
 .LP
 This file is part of SLURM, a resource management program.
-For details, see <http://www.llnl.gov/linux/slurm/>.
+For details, see <https://computing.llnl.gov/linux/slurm/>.
 .LP
 SLURM is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
diff --git a/doc/man/man5/slurm.conf.5 b/doc/man/man5/slurm.conf.5
index 2ff61088c9bc4ac46756626a3c51b52218250942..b330630f1e8b05ef246a9f57e3141eac361d2f9b 100644
--- a/doc/man/man5/slurm.conf.5
+++ b/doc/man/man5/slurm.conf.5
@@ -41,7 +41,7 @@ This may be fine for testing purposes, but
 "http://www.theether.org/authd/" for more information).
 "auth/munge" indicates that Chris Dunlap's munge is to be used
 (this is the best supported authentication mechanism for SLURM, 
-see "http://www.llnl.gov/linux/munge/" for more information).
+see "https://computing.llnl.gov/linux/munge/" for more information).
 All SLURM daemons and commands must be terminated prior to changing 
 the value of \fBAuthType\fR and later restarted (SLURM jobs can be 
 preserved).
@@ -1240,7 +1240,7 @@ Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 UCRL\-CODE\-226842.
 .LP
 This file is part of SLURM, a resource management program.
-For details, see <http://www.llnl.gov/linux/slurm/>.
+For details, see <https://computing.llnl.gov/linux/slurm/>.
 .LP
 SLURM is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
diff --git a/doc/man/man5/wiki.conf.5 b/doc/man/man5/wiki.conf.5
index 36cae1ca096fa68a4d87eaecde671e8c865a0e3d..4690072b7c41d58eb2f25db6512026a27ac198d2 100644
--- a/doc/man/man5/wiki.conf.5
+++ b/doc/man/man5/wiki.conf.5
@@ -160,7 +160,7 @@ Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 UCRL\-CODE\-226842.
 .LP
 This file is part of SLURM, a resource management program.
-For details, see <http://www.llnl.gov/linux/slurm/>.
+For details, see <https://computing.llnl.gov/linux/slurm/>.
 .LP
 SLURM is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
diff --git a/doc/man/man8/slurmctld.8 b/doc/man/man8/slurmctld.8
index e85216d0ecc360668b177d9967bf58fd841ff77f..0e37e751f987cae59727487b8e2b969dcf2a8ffd 100644
--- a/doc/man/man8/slurmctld.8
+++ b/doc/man/man8/slurmctld.8
@@ -60,7 +60,7 @@ Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 UCRL\-CODE\-226842.
 .LP
 This file is part of SLURM, a resource management program.
-For details, see <http://www.llnl.gov/linux/slurm/>.
+For details, see <https://computing.llnl.gov/linux/slurm/>.
 .LP
 SLURM is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
diff --git a/doc/man/man8/slurmd.8 b/doc/man/man8/slurmd.8
index 3430a7dd351a3dd12ff6007460d5a0fdf0a5e7ab..bca7fdc879c73f3b0bae72b3ccec4c00c6a0f65d 100644
--- a/doc/man/man8/slurmd.8
+++ b/doc/man/man8/slurmd.8
@@ -63,7 +63,7 @@ Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 UCRL\-CODE\-226842.
 .LP
 This file is part of SLURM, a resource management program.
-For details, see <http://www.llnl.gov/linux/slurm/>.
+For details, see <https://computing.llnl.gov/linux/slurm/>.
 .LP
 SLURM is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
diff --git a/doc/man/man8/slurmstepd.8 b/doc/man/man8/slurmstepd.8
index 0e4e85e267965b755508faaa60325969880d7dd6..fe27e4a23458e55f2d7fd7224d7beeac9c8bc0dd 100644
--- a/doc/man/man8/slurmstepd.8
+++ b/doc/man/man8/slurmstepd.8
@@ -16,7 +16,7 @@ Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 UCRL\-CODE\-226842.
 .LP
 This file is part of SLURM, a resource management program.
-For details, see <http://www.llnl.gov/linux/slurm/>.
+For details, see <https://computing.llnl.gov/linux/slurm/>.
 .LP
 SLURM is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
diff --git a/doc/man/man8/spank.8 b/doc/man/man8/spank.8
index cbaebcade9c3d38f1d0a9f01a278829015e01036..7f04657887b29412f639197433ecccfc8f421325 100644
--- a/doc/man/man8/spank.8
+++ b/doc/man/man8/spank.8
@@ -433,7 +433,7 @@ Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 UCRL\-CODE\-226842.
 .LP
 This file is part of SLURM, a resource management program.
-For details, see <http://www.llnl.gov/linux/slurm/>.
+For details, see <https://computing.llnl.gov/linux/slurm/>.
 .LP
 SLURM is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
diff --git a/slurm.spec b/slurm.spec
index 33e2a50cbbecc5997057cfc7e57abc68d127a69d..c1351af045b8010c0bf73cfc59ca9d87c7e8329a 100644
--- a/slurm.spec
+++ b/slurm.spec
@@ -1,4 +1,4 @@
-# $Id: slurm.spec 12730 2007-11-29 19:51:09Z jette $
+# $Id: slurm.spec 12767 2007-12-03 17:00:12Z jette $
 #
 # Note that this package is not relocatable
 
@@ -60,16 +60,16 @@
 %endif
 
 Name:    slurm
-Version: 1.2.20
-Release: 1%{?dist}
+Version: 1.2.21
+Release: 1
 
 Summary: Simple Linux Utility for Resource Management
 
 License: GPL 
 Group: System Environment/Base
-Source: slurm-1.2.20.tar.bz2
+Source: slurm-1.2.21.tar.bz2
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
-URL: http://www.llnl.gov/linux/slurm
+URL: https://computing.llnl.gov/linux/slurm/
 BuildRequires: openssl-devel >= 0.9.6 openssl >= 0.9.6
 
 %description 
@@ -211,7 +211,7 @@ SLURM process tracking plugin for SGI job containers.
 #############################################################################
 
 %prep
-%setup -n slurm-1.2.20
+%setup -n slurm-1.2.21
 
 %build
 %configure --program-prefix=%{?_program_prefix:%{_program_prefix}} \
diff --git a/src/api/node_info.c b/src/api/node_info.c
index 6c07235bd91d658c7508ca3606b77876a874da16..b22adfa2e2357467f1490ea970ad478e05ebdd63 100644
--- a/src/api/node_info.c
+++ b/src/api/node_info.c
@@ -1,6 +1,6 @@
 /*****************************************************************************\
  *  node_info.c - get/print the node state information of slurm
- *  $Id: node_info.c 10851 2007-01-23 21:19:14Z morrone $
+ *  $Id: node_info.c 12825 2007-12-14 21:23:57Z jette $
  *****************************************************************************
  *  Copyright (C) 2002-2006 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -40,6 +40,10 @@
 #  include "config.h"
 #endif
 
+#ifdef HAVE_SYS_SYSLOG_H
+#  include <sys/syslog.h>
+#endif
+
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/src/api/node_select_info.c b/src/api/node_select_info.c
index ab1c89e1888e853b4ed6576465d5bf30277448b3..cefbe01d0ccadba377606b27454c3befc9dbaddf 100644
--- a/src/api/node_select_info.c
+++ b/src/api/node_select_info.c
@@ -1,7 +1,7 @@
 /*****************************************************************************\
  *  node_select_info.c - get the node select plugin state information of slurm
  *
- *  $Id: node_select_info.c 10574 2006-12-15 23:38:29Z jette $
+ *  $Id: node_select_info.c 12825 2007-12-14 21:23:57Z jette $
  *****************************************************************************
  *  Copyright (C) 2005 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -41,6 +41,10 @@
 #  include "config.h"
 #endif
 
+#ifdef HAVE_SYS_SYSLOG_H
+#  include <sys/syslog.h>
+#endif
+
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/src/common/Makefile.am b/src/common/Makefile.am
index 063d1dac9817c08b3dc5fc22373df97317ae8478..0dfe31e6bfe615666fda3a97ce40650cb0a45bc0 100644
--- a/src/common/Makefile.am
+++ b/src/common/Makefile.am
@@ -10,7 +10,7 @@ build_unsetenv_src = unsetenv.c unsetenv.h
 extra_unsetenv_src = 
 endif
 
-INCLUDES     = -I$(top_srcdir) $(SSL_CPPFLAGS) 
+INCLUDES     = -I$(top_srcdir) $(SSL_CPPFLAGS)
 
 noinst_LTLIBRARIES = 			\
 	libcommon.la 			\
diff --git a/src/common/Makefile.in b/src/common/Makefile.in
index 6f1c3d291abd1472b6412265c0730a259d7ef9a9..39c4e23ad89ccd69adeb65be4ca3dd9cdf030869 100644
--- a/src/common/Makefile.in
+++ b/src/common/Makefile.in
@@ -304,7 +304,7 @@ AUTOMAKE_OPTIONS = foreign
 @HAVE_UNSETENV_TRUE@build_unsetenv_src = 
 @HAVE_UNSETENV_FALSE@extra_unsetenv_src = 
 @HAVE_UNSETENV_TRUE@extra_unsetenv_src = unsetenv.c unsetenv.h
-INCLUDES = -I$(top_srcdir) $(SSL_CPPFLAGS) 
+INCLUDES = -I$(top_srcdir) $(SSL_CPPFLAGS)
 noinst_LTLIBRARIES = \
 	libcommon.la 			\
 	libdaemonize.la 		\
diff --git a/src/common/env.c b/src/common/env.c
index ac32d5254bc407784c5faa6bffee0023e5584675..c96fee623c91faf60b76b813fce05ecb36252281 100644
--- a/src/common/env.c
+++ b/src/common/env.c
@@ -1,6 +1,6 @@
 /*****************************************************************************\
  *  src/common/env.c - add an environment variable to environment vector
- *  $Id: env.c 12697 2007-11-27 22:02:29Z jette $
+ *  $Id: env.c 12884 2007-12-21 00:41:34Z jette $
  *****************************************************************************
  *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -1315,7 +1315,7 @@ char **env_array_user_default(const char *username, int timeout, int mode)
 		close(2);
 		open("/dev/null", O_WRONLY);
 		snprintf(cmdstr, sizeof(cmdstr),
-			 "echo; echo; echo; echo %s; env; echo %s",
+			 "/bin/echo; /bin/echo; /bin/echo; /bin/echo %s; /bin/env; /bin/echo %s",
 			 starttoken, stoptoken);
 		if      (mode == 1)
 			execl("/bin/su", "su", username, "-c", cmdstr, NULL);
diff --git a/src/common/log.c b/src/common/log.c
index f6d0d93d8fdfe737ef8c379656b8adb4811c0ea4..9493af549b8d5c8db6615ae67409f3904c849cfb 100644
--- a/src/common/log.c
+++ b/src/common/log.c
@@ -1,6 +1,6 @@
 /*****************************************************************************\
  *  log.c - slurm logging facilities
- *  $Id: log.c 10574 2006-12-15 23:38:29Z jette $
+ *  $Id: log.c 12825 2007-12-14 21:23:57Z jette $
  *****************************************************************************
  *  Copyright (C) 2002 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -59,7 +59,6 @@
 
 #include <stdarg.h>
 #include <errno.h>
-#include <syslog.h>
 
 #ifdef WITH_PTHREADS
 #  include <pthread.h>
diff --git a/src/common/log.h b/src/common/log.h
index edf87f52215f658e4c3b1e91fbb3332a670dfba1..b257b138cd99f33d347885909e8dff3a3f09fedf 100644
--- a/src/common/log.h
+++ b/src/common/log.h
@@ -45,6 +45,14 @@
 #ifndef _LOG_H
 #define _LOG_H
 
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#ifdef HAVE_SYS_SYSLOG_H
+#  include <sys/syslog.h>
+#endif
+
 #include <syslog.h> 	
 #include <stdio.h>
 
diff --git a/src/common/optz.h b/src/common/optz.h
index 76bb301526ebdd80f13ce3d29e28dabebfc17d9e..4898b4d6e10059d0013e482bd9e46773145e71c5 100644
--- a/src/common/optz.h
+++ b/src/common/optz.h
@@ -41,7 +41,9 @@
 #  include <config.h>
 #endif
 
-#define _GNU_SOURCE
+#ifndef   _GNU_SOURCE
+#  define _GNU_SOURCE
+#endif
 
 #if HAVE_GETOPT_H
 #  include <getopt.h>
diff --git a/src/common/parse_time.c b/src/common/parse_time.c
index ea7882fdf06af30e856994359c9ff92afe4894a3..b7253ac918966a6b5d61eb44984b66314319abb1 100644
--- a/src/common/parse_time.c
+++ b/src/common/parse_time.c
@@ -39,7 +39,9 @@
 #include <stdio.h>
 #include <time.h>
 #include <strings.h>
-#define __USE_ISOC99 /* isblank() */
+#ifndef   __USE_ISOC99
+#  define __USE_ISOC99 /* isblank() */
+#endif
 #include <ctype.h>
 
 #include <slurm/slurm.h>
diff --git a/src/common/plugstack.h b/src/common/plugstack.h
index 24b81e1e3292e747b12f3b0234bc5f1eedb18cc4..7a7f57a8023cc81a7b5f8b8a29d36fe3f795389f 100644
--- a/src/common/plugstack.h
+++ b/src/common/plugstack.h
@@ -40,7 +40,9 @@
 #  include <config.h>
 #endif
 
-#define _GNU_SOURCE
+#ifndef   _GNU_SOURCE
+#  define _GNU_SOURCE
+#endif
 
 #if HAVE_GETOPT_H
 #  include <getopt.h>
diff --git a/src/common/slurm_protocol_api.c b/src/common/slurm_protocol_api.c
index 9d1da7691417de41310a076e5f1eb2d10842caf9..550e855148bc9dca7bffd87449c0d74c29a5cd68 100644
--- a/src/common/slurm_protocol_api.c
+++ b/src/common/slurm_protocol_api.c
@@ -856,7 +856,7 @@ int slurm_receive_msg(slurm_fd fd, slurm_msg_t *msg, int timeout)
 	}
 	//info("ret_cnt = %d",header.ret_cnt);
 	if(header.ret_cnt > 0) {
-		error("we recieved more than one message back use "
+		error("we received more than one message back use "
 		      "slurm_receive_msgs instead");
 		header.ret_cnt = 0;
 		list_destroy(header.ret_list);
@@ -1165,7 +1165,7 @@ int slurm_receive_msg_and_forward(slurm_fd fd, slurm_addr *orig_addr,
 		goto total_return;
 	}
 	if(header.ret_cnt > 0) {
-		error("we recieved more than one message back use "
+		error("we received more than one message back use "
 		      "slurm_receive_msgs instead");
 		header.ret_cnt = 0;
 		list_destroy(header.ret_list);
diff --git a/src/common/slurm_protocol_pack.c b/src/common/slurm_protocol_pack.c
index 5f33633d4929ac17c547543efd76874018809855..9a67b46f56e12ae240500763c641cf82b5ff0683 100644
--- a/src/common/slurm_protocol_pack.c
+++ b/src/common/slurm_protocol_pack.c
@@ -1,7 +1,7 @@
 /****************************************************************************\
  *  slurm_protocol_pack.c - functions to pack and unpack structures for RPCs
  *
- *  $Id: slurm_protocol_pack.c 12532 2007-10-22 22:52:39Z jette $
+ *  $Id: slurm_protocol_pack.c 12814 2007-12-11 23:28:22Z jette $
  *****************************************************************************
  *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -3199,7 +3199,8 @@ _unpack_stat_jobacct_msg(stat_jobacct_msg_t ** msg_ptr, Buf buffer)
 	safe_unpack32(&msg->return_code, buffer);
 	safe_unpack32(&msg->step_id, buffer);
 	safe_unpack32(&msg->num_tasks, buffer);
-	jobacct_g_unpack(&msg->jobacct, buffer);
+	if (jobacct_g_unpack(&msg->jobacct, buffer) != SLURM_SUCCESS)
+		goto unpack_error;
 
 	return SLURM_SUCCESS;
 
@@ -3263,7 +3264,8 @@ _unpack_step_complete_msg(step_complete_msg_t ** msg_ptr, Buf buffer)
 	safe_unpack32(&msg->range_first, buffer);
 	safe_unpack32(&msg->range_last, buffer);
 	safe_unpack32(&msg->step_rc, buffer);
-	jobacct_g_unpack(&msg->jobacct, buffer);
+	if (jobacct_g_unpack(&msg->jobacct, buffer) != SLURM_SUCCESS)
+		goto unpack_error;
 
 	return SLURM_SUCCESS;
 
diff --git a/src/common/slurm_protocol_socket_implementation.c b/src/common/slurm_protocol_socket_implementation.c
index 11038e58279cba17f8ecf03b309ac1210c1e63da..023f377b6910e44add0b99c3292cfc2a5efb69db 100644
--- a/src/common/slurm_protocol_socket_implementation.c
+++ b/src/common/slurm_protocol_socket_implementation.c
@@ -1,7 +1,7 @@
 /*****************************************************************************\
  *  slurm_protocol_socket_implementation.c - slurm communications interfaces 
  *                                           based upon sockets.
- *  $Id: slurm_protocol_socket_implementation.c 12005 2007-08-14 17:20:11Z jette $
+ *  $Id: slurm_protocol_socket_implementation.c 12827 2007-12-14 22:29:30Z da $
  *****************************************************************************
  *  Copyright (C) 2002-2006 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -294,7 +294,7 @@ int _slurm_send_timeout(slurm_fd fd, char *buf, size_t size,
 			sent = SLURM_ERROR;
 			goto done;			
 		}
-
+		
                 rc = _slurm_send(fd, &buf[sent], (size - sent), flags);
                 if (rc < 0) {
  			if (errno == EINTR)
diff --git a/src/common/stepd_api.c b/src/common/stepd_api.c
index 964eb17ce3b6e995eabb0061951eaf745037b018..57946193e2cf2ad09e69e4822eee8123eaa0f02e 100644
--- a/src/common/stepd_api.c
+++ b/src/common/stepd_api.c
@@ -1,6 +1,6 @@
 /*****************************************************************************\
  *  src/common/stepd_api.c - slurmstepd message API
- *  $Id: stepd_api.c 11890 2007-07-30 16:03:53Z grondo $
+ *  $Id: stepd_api.c 12808 2007-12-11 17:25:08Z jette $
  *****************************************************************************
  *  Copyright (C) 2005 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -36,7 +36,10 @@
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
 \*****************************************************************************/
 
-#define _GNU_SOURCE
+#ifndef   _GNU_SOURCE
+#  define _GNU_SOURCE
+#endif
+
 #include <stdlib.h>
 #include <sys/types.h>
 #include <sys/socket.h>
diff --git a/src/plugins/jobacct/Makefile.am b/src/plugins/jobacct/Makefile.am
index 1039e1ad8067eceb6ad7ec002c938c0cc457ecc8..1412b0808e59c31f0cef88d3f41b88ddde85262b 100644
--- a/src/plugins/jobacct/Makefile.am
+++ b/src/plugins/jobacct/Makefile.am
@@ -1,3 +1,3 @@
 # Makefile for jobacct plugins
 
-SUBDIRS = linux aix none
+SUBDIRS = linux aix none gold
diff --git a/src/plugins/jobacct/Makefile.in b/src/plugins/jobacct/Makefile.in
index 0df53ec283840961ae4dcb9a72ebae2ba6d75622..4fa1bb9b966bf6c2b3017416376598243dd2133a 100644
--- a/src/plugins/jobacct/Makefile.in
+++ b/src/plugins/jobacct/Makefile.in
@@ -234,7 +234,7 @@ target_os = @target_os@
 target_vendor = @target_vendor@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-SUBDIRS = linux aix none
+SUBDIRS = linux aix none gold
 all: all-recursive
 
 .SUFFIXES:
diff --git a/src/plugins/jobacct/gold/Makefile.am b/src/plugins/jobacct/gold/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..1602fd4b4b3981c204cefc440d4cf06e144d10d6
--- /dev/null
+++ b/src/plugins/jobacct/gold/Makefile.am
@@ -0,0 +1,16 @@
+# Makefile for jobacct/none plugin
+
+AUTOMAKE_OPTIONS = foreign
+
+PLUGIN_FLAGS = -module -avoid-version --export-dynamic 
+
+# Gold job completion logging plugin.
+INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src/common
+
+pkglib_LTLIBRARIES = jobacct_gold.la
+jobacct_gold_la_SOURCES = jobacct_gold.c \
+			gold_interface.c gold_interface.h \
+			base64.c base64.h
+jobacct_gold_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS)
+
+
diff --git a/src/plugins/jobacct/gold/Makefile.in b/src/plugins/jobacct/gold/Makefile.in
new file mode 100644
index 0000000000000000000000000000000000000000..1419248a020ef4250f05e7fc908e685ab8c5dddb
--- /dev/null
+++ b/src/plugins/jobacct/gold/Makefile.in
@@ -0,0 +1,549 @@
+# Makefile.in generated by automake 1.10 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# Makefile for jobacct/none plugin
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = src/plugins/jobacct/gold
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/acx_pthread.m4 \
+	$(top_srcdir)/auxdir/slurm.m4 \
+	$(top_srcdir)/auxdir/x_ac__system_configuration.m4 \
+	$(top_srcdir)/auxdir/x_ac_affinity.m4 \
+	$(top_srcdir)/auxdir/x_ac_aix.m4 \
+	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
+	$(top_srcdir)/auxdir/x_ac_debug.m4 \
+	$(top_srcdir)/auxdir/x_ac_elan.m4 \
+	$(top_srcdir)/auxdir/x_ac_federation.m4 \
+	$(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \
+	$(top_srcdir)/auxdir/x_ac_gtk.m4 \
+	$(top_srcdir)/auxdir/x_ac_munge.m4 \
+	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
+	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
+	$(top_srcdir)/auxdir/x_ac_readline.m4 \
+	$(top_srcdir)/auxdir/x_ac_setpgrp.m4 \
+	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
+	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
+	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
+	$(top_srcdir)/auxdir/x_ac_xcpu.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h $(top_builddir)/slurm/slurm.h
+CONFIG_CLEAN_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+pkglibLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+jobacct_gold_la_LIBADD =
+am_jobacct_gold_la_OBJECTS = jobacct_gold.lo gold_interface.lo \
+	base64.lo
+jobacct_gold_la_OBJECTS = $(am_jobacct_gold_la_OBJECTS)
+jobacct_gold_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(jobacct_gold_la_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I. -I$(top_builddir) -I$(top_builddir)/slurm@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/auxdir/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(jobacct_gold_la_SOURCES)
+DIST_SOURCES = $(jobacct_gold_la_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTHD_CFLAGS = @AUTHD_CFLAGS@
+AUTHD_LIBS = @AUTHD_LIBS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BG_INCLUDES = @BG_INCLUDES@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CMD_LDFLAGS = @CMD_LDFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ELAN_LIBS = @ELAN_LIBS@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FEDERATION_LDFLAGS = @FEDERATION_LDFLAGS@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+GTK2_CFLAGS = @GTK2_CFLAGS@
+GTK2_LIBS = @GTK2_LIBS@
+HAVEPKGCONFIG = @HAVEPKGCONFIG@
+HAVE_AIX = @HAVE_AIX@
+HAVE_ELAN = @HAVE_ELAN@
+HAVE_FEDERATION = @HAVE_FEDERATION@
+HAVE_SOME_CURSES = @HAVE_SOME_CURSES@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIB_LDFLAGS = @LIB_LDFLAGS@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+MUNGE_CPPFLAGS = @MUNGE_CPPFLAGS@
+MUNGE_LDFLAGS = @MUNGE_LDFLAGS@
+MUNGE_LIBS = @MUNGE_LIBS@
+NCURSES = @NCURSES@
+NUMA_LIBS = @NUMA_LIBS@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PAM_LIBS = @PAM_LIBS@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PLPA_LIBS = @PLPA_LIBS@
+PROCTRACKDIR = @PROCTRACKDIR@
+PROJECT = @PROJECT@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+READLINE_LIBS = @READLINE_LIBS@
+RELEASE = @RELEASE@
+SED = @SED@
+SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
+SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLURMCTLD_PORT = @SLURMCTLD_PORT@
+SLURMD_PORT = @SLURMD_PORT@
+SLURM_API_AGE = @SLURM_API_AGE@
+SLURM_API_CURRENT = @SLURM_API_CURRENT@
+SLURM_API_MAJOR = @SLURM_API_MAJOR@
+SLURM_API_REVISION = @SLURM_API_REVISION@
+SLURM_API_VERSION = @SLURM_API_VERSION@
+SLURM_MAJOR = @SLURM_MAJOR@
+SLURM_MICRO = @SLURM_MICRO@
+SLURM_MINOR = @SLURM_MINOR@
+SLURM_VERSION = @SLURM_VERSION@
+SO_LDFLAGS = @SO_LDFLAGS@
+SSL_CPPFLAGS = @SSL_CPPFLAGS@
+SSL_LDFLAGS = @SSL_LDFLAGS@
+SSL_LIBS = @SSL_LIBS@
+STRIP = @STRIP@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AUTOMAKE_OPTIONS = foreign
+PLUGIN_FLAGS = -module -avoid-version --export-dynamic 
+
+# Gold job completion logging plugin.
+INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src/common
+pkglib_LTLIBRARIES = jobacct_gold.la
+jobacct_gold_la_SOURCES = jobacct_gold.c \
+			gold_interface.c gold_interface.h \
+			base64.c base64.h
+
+jobacct_gold_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/plugins/jobacct/gold/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  src/plugins/jobacct/gold/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
+	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
+	  if test -f $$p; then \
+	    f=$(am__strip_dir) \
+	    echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	    $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \
+	  else :; fi; \
+	done
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
+	  p=$(am__strip_dir) \
+	  echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \
+	  $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+jobacct_gold.la: $(jobacct_gold_la_OBJECTS) $(jobacct_gold_la_DEPENDENCIES) 
+	$(jobacct_gold_la_LINK) -rpath $(pkglibdir) $(jobacct_gold_la_OBJECTS) $(jobacct_gold_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base64.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gold_interface.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jobacct_gold.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/plugins/jobacct/gold/base64.c b/src/plugins/jobacct/gold/base64.c
new file mode 100644
index 0000000000000000000000000000000000000000..803f2b0536463d3fd215a35e42af04c4a0b2d799
--- /dev/null
+++ b/src/plugins/jobacct/gold/base64.c
@@ -0,0 +1,199 @@
+/*****************************************************************************\
+ *  base64.c - encoding for communication with gold.
+ *
+ *  $Id: storage_filetxt.c 10893 2007-01-29 21:53:48Z da $
+ *****************************************************************************
+ *  Copyright (C) 2004-2007 The Regents of the University of California.
+ *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
+ *  Written by Danny Auble <da@llnl.gov>
+ *  
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://www.llnl.gov/linux/slurm/>.
+ *  
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission 
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and 
+ *  distribute linked combinations including the two. You must obey the GNU 
+ *  General Public License in all respects for all of the code used other than 
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this 
+ *  exception to your version of the file(s), but you are not obligated to do 
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in 
+ *  the program, then also delete it here.
+ *  
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *  
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+\*****************************************************************************/
+
+#include "base64.h"
+#include <string.h>
+
+static char basis_64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+
+/* To tell if char is a valid base64 */
+static int _is_base64(unsigned char c) {
+	if((c >= '/' && c <= '9') 
+	   || (c >= 'A' && c <= 'Z')
+	   || (c >= 'a' && c <= 'z')
+	   || (c == '+')) 
+		return 1;
+	return 0;
+}
+
+/*
+ * encode_base64 - given a char * of in_len will return an encoded
+ *                 version
+ * IN in_str - pointer to string to be encoded
+ * IN in_len - string length of in_str
+ * RET pointer to encoded string or NULL on failure 
+ * NOTE: allocates memory that should be xfreed with xfree.
+ */
+extern unsigned char *encode_base64(const unsigned char* in_str, 
+				    unsigned int in_len)
+{
+	unsigned char *ret_str = NULL;
+	int i = 0;
+	int j = 0;
+	unsigned char char_array_3[3];
+	unsigned char char_array_4[4];
+	int pos = 0;
+	/* calculate the length of the result */
+	int rlen = (in_len+2) / 3 * 4;	 /* encoded bytes */
+
+	rlen++; /* for the eol */
+	ret_str = xmalloc(sizeof(unsigned char) * rlen);
+	
+	debug2("encoding %s", in_str);
+
+	while (in_len--) {
+		char_array_3[i++] = *(in_str++);
+		if (i == 3) {
+			char_array_4[0] = (char_array_3[0] & 0xfc) >> 2;
+			char_array_4[1] = ((char_array_3[0] & 0x03) << 4)
+				+ ((char_array_3[1] & 0xf0) >> 4);
+			char_array_4[2] = ((char_array_3[1] & 0x0f) << 2)
+				+ ((char_array_3[2] & 0xc0) >> 6);
+			char_array_4[3] = char_array_3[2] & 0x3f;
+			
+			for(i = 0; (i <4) ; i++)
+				ret_str[pos++] = basis_64[char_array_4[i]];
+			i = 0;
+		}
+	}
+	
+	if (i) {
+		for(j = i; j < 3; j++)
+			char_array_3[j] = '\0';
+		
+		char_array_4[0] = (char_array_3[0] & 0xfc) >> 2;
+		char_array_4[1] = ((char_array_3[0] & 0x03) << 4)
+			+ ((char_array_3[1] & 0xf0) >> 4);
+		char_array_4[2] = ((char_array_3[1] & 0x0f) << 2)
+			+ ((char_array_3[2] & 0xc0) >> 6);
+		char_array_4[3] = char_array_3[2] & 0x3f;
+		
+		for (j = 0; (j < i + 1); j++)
+			ret_str[pos++] = basis_64[char_array_4[j]];
+		
+		while((i++ < 3))
+			ret_str[pos++] = '=';
+		
+	}
+
+	debug2("encoded %s", ret_str);
+	
+	return ret_str;
+}
+
+/*
+ * decode_base64 - given a char * will return a decoded version
+ *
+ * IN in_str - pointer to string to be decoded
+ * RET pointer to decoded string or NULL on failure
+ * NOTE: allocates memory that should be xfreed with xfree.
+ */
+extern unsigned char *decode_base64(const unsigned char *in_str)
+{
+	int pos = 0;
+	int in_len = strlen((char *)in_str);
+	int i = 0;
+	int j = 0;
+	int in_pos = 0;
+	unsigned char char_array_4[4], char_array_3[3];
+	unsigned char *ret_str = NULL;
+
+	int rlen = in_len * 3 / 4; /* always enough, but sometimes too
+				    * much */
+       	
+	debug2("decoding %s", in_str);
+
+	ret_str = xmalloc(sizeof(unsigned char) * rlen);
+	memset(ret_str, 0, rlen);
+	
+	while (in_len-- && ( in_str[in_pos] != '=')
+	       && _is_base64(in_str[in_pos])) {
+		char_array_4[i++] = in_str[in_pos];
+		in_pos++;
+		if (i == 4) {
+			for (i=0; i<4; i++) {
+				int found = 0;
+				while(basis_64[found] 
+				      && basis_64[found] != char_array_4[i])
+					found++;
+				if(!basis_64[found]) 
+					found = 0;
+				char_array_4[i] = found;
+			}
+			char_array_3[0] = (char_array_4[0] << 2) 
+				+ ((char_array_4[1] & 0x30) >> 4);
+			char_array_3[1] = ((char_array_4[1] & 0xf) << 4) 
+				+ ((char_array_4[2] & 0x3c) >> 2);
+			char_array_3[2] = ((char_array_4[2] & 0x3) << 6)
+				+ char_array_4[3];
+			for (i = 0; i<3; i++)
+				ret_str[pos++] = char_array_3[i];
+			i = 0;
+		}
+	}
+
+	if (i) {
+		for (j=i; j<4; j++)
+			char_array_4[j] = 0;
+
+		for (j=0; j<4; j++) {
+			int found = 0;
+			while(basis_64[found] 
+			      && basis_64[found] != char_array_4[j])
+				found++;
+			if(!basis_64[found]) 
+				found = 0;
+			
+			char_array_4[j] = found;
+		}
+
+		char_array_3[0] = (char_array_4[0] << 2) 
+			+ ((char_array_4[1] & 0x30) >> 4);
+		char_array_3[1] = ((char_array_4[1] & 0xf) << 4)
+			+ ((char_array_4[2] & 0x3c) >> 2);
+		char_array_3[2] = ((char_array_4[2] & 0x3) << 6) 
+			+ char_array_4[3];
+
+		for (j = 0; (j < i - 1); j++)
+			ret_str[pos++] = char_array_3[j];
+	}
+
+	debug2("decoded %s", ret_str);
+
+	return ret_str;
+}
diff --git a/src/plugins/jobacct/gold/base64.h b/src/plugins/jobacct/gold/base64.h
new file mode 100644
index 0000000000000000000000000000000000000000..a5a9980d8ecf5597e4b3d28d9d6d35c91a92fba5
--- /dev/null
+++ b/src/plugins/jobacct/gold/base64.h
@@ -0,0 +1,74 @@
+/*****************************************************************************\
+ *  base64.h - encoding for communication with gold.
+ *
+ *  $Id: storage_filetxt.c 10893 2007-01-29 21:53:48Z da $
+ *****************************************************************************
+ *  Copyright (C) 2004-2007 The Regents of the University of California.
+ *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
+ *  Written by Danny Auble <da@llnl.gov>
+ *  
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://www.llnl.gov/linux/slurm/>.
+ *  
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission 
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and 
+ *  distribute linked combinations including the two. You must obey the GNU 
+ *  General Public License in all respects for all of the code used other than 
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this 
+ *  exception to your version of the file(s), but you are not obligated to do 
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in 
+ *  the program, then also delete it here.
+ *  
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *  
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+\*****************************************************************************/
+#ifndef _HAVE_GOLD_BASE64_H
+#define _HAVE_GOLD_BASE64_H
+
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#if HAVE_STDINT_H
+#  include <stdint.h>
+#endif
+#if HAVE_INTTYPES_H
+#  include <inttypes.h>
+#endif
+
+#include "src/common/xmalloc.h"
+
+/*
+ * encode_base64 - given a char * of in_len will return an encoded
+ *                 version
+ * IN in_str - pointer to string to be encoded
+ * IN in_len - string length of in_str
+ * RET pointer to encoded string 
+ * NOTE: allocates memory that should be xfreed with xfree.
+ */
+extern unsigned char *encode_base64(const unsigned char *in_str,
+				    unsigned int in_len);
+
+/*
+ * decode_base64 - given a char * will return a decoded version
+ *
+ * IN in_str - pointer to string to be decoded
+ * RET pointer to decoded string
+ * NOTE: allocates memory that should be xfreed with xfree.
+ */
+extern unsigned char *decode_base64(const unsigned char *in_str);
+
+#endif
diff --git a/src/plugins/jobacct/gold/gold_interface.c b/src/plugins/jobacct/gold/gold_interface.c
new file mode 100644
index 0000000000000000000000000000000000000000..fe94846a82a81d8941acb5f245bb64205eb0fde4
--- /dev/null
+++ b/src/plugins/jobacct/gold/gold_interface.c
@@ -0,0 +1,576 @@
+/*****************************************************************************\
+ *  gold_interface.h - interface to the gold daemon commands.
+ *
+ *  $Id: storage_filetxt.c 10893 2007-01-29 21:53:48Z da $
+ *****************************************************************************
+ *  Copyright (C) 2004-2007 The Regents of the University of California.
+ *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
+ *  Written by Danny Auble <da@llnl.gov>
+ *  
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://www.llnl.gov/linux/slurm/>.
+ *  
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission 
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and 
+ *  distribute linked combinations including the two. You must obey the GNU 
+ *  General Public License in all respects for all of the code used other than 
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this 
+ *  exception to your version of the file(s), but you are not obligated to do 
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in 
+ *  the program, then also delete it here.
+ *  
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *  
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+\*****************************************************************************/
+
+#include "gold_interface.h"
+#include "base64.h"
+
+#include <openssl/hmac.h>
+#include <openssl/sha.h>
+
+#include "src/common/slurm_protocol_interface.h"
+#include "src/common/slurm_protocol_api.h"
+
+#define MAX_RETRY 5
+
+static slurm_fd gold_fd; // gold connection 
+static char *gold_machine = NULL;
+static char *gold_key = NULL;
+static char *gold_host = NULL;
+static uint16_t gold_port = 0;
+static int gold_init = 0;
+
+static char *_get_return_value(char *gold_msg, int *i)
+{
+	char tmp_buff[256];
+	int j=0;
+	int pos = (*i);
+
+	while(gold_msg[pos] && j < 256) {
+		if(gold_msg[pos] == '<') 
+			break;
+		
+		tmp_buff[j++] = gold_msg[pos++];
+	}
+
+	while(gold_msg[pos] && gold_msg[pos] != '>')
+		pos++;
+
+	(*i) = pos;
+
+	tmp_buff[j] = '\0';
+	return xstrdup(tmp_buff);
+}
+
+static char *_get_return_name(char *gold_msg, int *i)
+{
+	char tmp_buff[256];
+	int j=0;
+	int pos = *i;
+
+	while(gold_msg[pos] && j < 256) {
+		if(gold_msg[pos] == '>') 
+			break;
+		
+		tmp_buff[j++] = gold_msg[pos++];
+	}
+
+	(*i) = pos+1;
+
+	tmp_buff[j] = '\0';
+	return xstrdup(tmp_buff);
+}
+
+static gold_response_entry_t *_create_response_entry(char *object,
+						     char *gold_msg, int *i) 
+{
+	gold_response_entry_t *resp_entry =
+		xmalloc(sizeof(gold_response_entry_t));
+	gold_name_value_t *name_val = NULL;
+	int olen = strlen(object);
+
+	/* FIXME: we might want to check if the last char was a < to
+	 * add this if it is 
+	 */
+	(*i) += (olen + 1); //assume what is coming in is the name
+	resp_entry->name_val = list_create(destroy_gold_name_value);
+	while(gold_msg[*i]) {
+		if(!strncmp(gold_msg+(*i), object, olen)) {
+			(*i) += (olen + 1); //get to the end of the object
+			break;
+		} else if(gold_msg[(*i)] == '<' && gold_msg[(*i)+1] != '/') {
+			// found the front of a selection
+			(*i)++;
+			
+			name_val = xmalloc(sizeof(gold_name_value_t));
+			name_val->name = _get_return_name(gold_msg, i);
+			name_val->value = _get_return_value(gold_msg, i);
+			
+			debug3("got %s = %s", name_val->name, name_val->value);
+			list_push(resp_entry->name_val, name_val);
+		}
+		(*i)++;
+	}
+
+	return resp_entry;
+}
+
+static int _start_communication()
+{
+	static slurm_addr gold_addr;
+	static int gold_addr_set = 0;
+	char *init_msg = "POST /SSSRMAP3 HTTP/1.1\r\nContent-Type: text/xml; charset=\"utf-8\"\r\nTransfer-Encoding: chunked\r\n\r\n";
+	int rc = 0;
+	
+	if(!gold_init) {
+		error("start_gold_communication: "
+		      "need to run setup_gold_info before this");
+		return SLURM_ERROR;
+	}
+	
+	if(!gold_addr_set) {
+		slurm_set_addr(&gold_addr, gold_port, gold_host);
+		gold_addr_set = 1;
+	}
+	
+	if ((gold_fd = slurm_open_msg_conn(&gold_addr)) < 0) {
+		error("start_gold_communication to %s: %m", gold_host);
+		return SLURM_ERROR;
+	}
+
+	debug3("Connected to %s(%d)", gold_host, gold_port);
+	rc = _slurm_send_timeout(gold_fd, init_msg, strlen(init_msg),
+				 SLURM_PROTOCOL_NO_SEND_RECV_FLAGS,
+				 (slurm_get_msg_timeout() * 1000));
+	
+	if (rc < 0) {
+		error("_slurm_send_timeout: %m");
+		return SLURM_ERROR;
+	}
+	return SLURM_SUCCESS;
+}
+
+static int _end_communication()
+{
+	int rc = SLURM_SUCCESS;
+	int retry = 0;
+	/* 
+	 *  Attempt to close an open connection
+	 */
+	while ((slurm_shutdown_msg_conn(gold_fd) < 0) && (errno == EINTR)) {
+		if (retry++ > MAX_RETRY) {
+			rc = SLURM_ERROR;
+			break;
+		}
+	}
+	return rc;
+}
+
+extern int init_gold(char *machine, char *keyfile, char *host, uint16_t port)
+{
+	int fp;
+	char key[256];
+	int i, bytes_read;
+	
+	if(!keyfile || !host || !machine) {
+		error("init_gold: Either no keyfile or host or machine given");
+		return SLURM_ERROR;
+	}
+
+	fp = open(keyfile, O_RDONLY);
+	bytes_read = read(fp, key, sizeof(key));
+	if ( bytes_read == -1) {
+		fatal("Error reading hash key from keyfile (%s): %m\n",
+		      keyfile);
+	}
+	key[bytes_read] = '\0'; /* Null terminate the string */
+	for (i = 0; i<bytes_read; i++) /* Remove carriage return if any */
+	{
+		if (key[i] == '\n' || key[i] == '\r') {
+			key[i] = '\0';
+			break;
+		}
+	}
+	
+	/* Close the file */
+	close(fp);
+	info("got the tolken as %s\n", key);
+	gold_machine = xstrdup(machine);
+	gold_key = xstrdup(key);
+	gold_host = xstrdup(host);
+	gold_port = port;
+	gold_init = 1;
+	
+	return SLURM_SUCCESS;
+}
+
+extern int fini_gold()
+{
+	gold_init = 0;
+	xfree(gold_machine);
+	xfree(gold_key);
+	xfree(gold_host);
+	
+	return SLURM_SUCCESS;
+}
+
+extern gold_request_t *create_gold_request(gold_object_t object,
+					   gold_object_t action)
+{
+	gold_request_t *gold_request = NULL;
+	
+	gold_request = xmalloc(sizeof(gold_request_t));
+
+	gold_request->object = object;
+	gold_request->action = action;
+	gold_request->assignments = list_create(destroy_gold_name_value);
+	gold_request->conditions = list_create(destroy_gold_name_value);
+	gold_request->selections = list_create(destroy_gold_char);
+	
+	return gold_request;
+}
+
+extern int destroy_gold_request(gold_request_t *gold_request)
+{
+	if(gold_request) {
+		if(gold_request->assignments)
+			list_destroy(gold_request->assignments);
+		if(gold_request->conditions)
+			list_destroy(gold_request->conditions);
+		if(gold_request->selections)
+			list_destroy(gold_request->selections);
+		xfree(gold_request->body);
+		xfree(gold_request->digest);
+		xfree(gold_request->signature);
+		xfree(gold_request);
+	}
+	return SLURM_SUCCESS;
+}
+
+extern int gold_request_add_assignment(gold_request_t *gold_request, 
+				       char *name, char *value)
+{
+	gold_name_value_t *name_val = xmalloc(sizeof(gold_name_value_t));
+	name_val->name = xstrdup(name);
+	name_val->value = xstrdup(value);
+	list_push(gold_request->assignments, name_val);
+		
+	return SLURM_SUCCESS;
+}
+
+extern int gold_request_add_condition(gold_request_t *gold_request, 
+				      char *name, char *value)
+{
+	gold_name_value_t *name_val = xmalloc(sizeof(gold_name_value_t));
+	name_val->name = xstrdup(name);
+	name_val->value = xstrdup(value);
+	list_push(gold_request->conditions, name_val);
+		
+	return SLURM_SUCCESS;
+}
+
+extern int gold_request_add_selection(gold_request_t *gold_request, char *name)
+{
+	list_push(gold_request->selections, xstrdup(name));
+	return SLURM_SUCCESS;
+}
+
+
+extern gold_response_t *get_gold_response(gold_request_t *gold_request)
+{
+	unsigned int slen = EVP_MAX_MD_SIZE;
+	unsigned int dlen = SHA_DIGEST_LENGTH;
+	unsigned char digest[dlen];
+	unsigned char signature[slen];
+	char c;
+	char *object = NULL;
+	char *action = NULL;
+	char *innerds = NULL;
+	char *gold_msg = NULL;
+	char tmp_buff[256];
+	char *tmp_char = NULL;
+	uint32_t ret_len = 0;
+	static int timeout = 0;
+	gold_response_t *gold_response = NULL;
+	gold_name_value_t *name_val = NULL;
+	ListIterator itr = NULL;
+	int rc = 0, i = 0;
+
+	if(!gold_init) {
+		error("get_gold_response: "
+		      "need to run setup_gold_info before this");
+		return NULL;
+	} else if(!gold_request) {
+		error("get_gold_response: No request given.");
+		return NULL;
+	}
+
+	if(!timeout) 
+		timeout = (slurm_get_msg_timeout() * 1000);
+	
+
+	switch(gold_request->object) {
+	case GOLD_OBJECT_ACCOUNT:
+		object = GOLD_OBJECT_ACCOUNT_STR;
+		break;
+	case GOLD_OBJECT_USER:
+		object = GOLD_OBJECT_USER_STR;
+		break;
+	case GOLD_OBJECT_PROJECT:
+		object = GOLD_OBJECT_PROJECT_STR;
+		break;
+	case GOLD_OBJECT_MACHINE:
+		object = GOLD_OBJECT_MACHINE_STR;
+		break;
+	case GOLD_OBJECT_JOB:
+		object = GOLD_OBJECT_JOB_STR;
+		break;
+	case GOLD_OBJECT_ROLEUSER:
+		object = GOLD_OBJECT_ROLEUSER_STR;
+		break;
+	default:
+		error("get_gold_response: "
+		      "unsupported object %d", gold_request->object);
+	}
+
+	switch(gold_request->action) {
+	case GOLD_ACTION_QUERY:
+		action = GOLD_ACTION_QUERY_STR;
+		itr = list_iterator_create(gold_request->selections);
+		while((tmp_char = list_next(itr))) {
+			xstrfmtcat(innerds, "<Get name=\"%s\"></Get>",
+				   tmp_char);
+		}
+		list_iterator_destroy(itr);
+		
+		break;
+	case GOLD_ACTION_CREATE:
+		action = GOLD_ACTION_CREATE_STR;
+		itr = list_iterator_create(gold_request->assignments);
+		while((name_val = list_next(itr))) {
+			xstrfmtcat(innerds, "<Set name=\"%s\">%s</Set>",
+				   name_val->name, name_val->value);
+		}
+		list_iterator_destroy(itr);
+		break;
+	case GOLD_ACTION_MODIFY:
+		action = GOLD_ACTION_MODIFY_STR;
+		itr = list_iterator_create(gold_request->assignments);
+		while((name_val = list_next(itr))) {
+			xstrfmtcat(innerds, "<Set name=\"%s\">%s</Set>",
+				   name_val->name, name_val->value);
+		}
+		list_iterator_destroy(itr);
+		break;
+	case GOLD_ACTION_DELETE:
+		action = GOLD_ACTION_DELETE_STR;
+		break;
+	default:
+		error("get_gold_response: "
+		      "unsupported action %d", gold_request->action);
+	}
+
+	itr = list_iterator_create(gold_request->conditions);
+	while((name_val = list_next(itr))) {
+		xstrfmtcat(innerds, "<Where name=\"%s\">%s</Where>",
+			   name_val->name, name_val->value);
+	}
+	list_iterator_destroy(itr);
+
+	xstrfmtcat(gold_request->body,
+		   "<Body><Request action=\"%s\" actor=\"%s\">"
+		   "<Object>%s</Object>",
+		   action, "slurm", object);
+	if(innerds) {
+		xstrcat(gold_request->body, innerds);
+		xfree(innerds);
+	}
+	xstrcat(gold_request->body, "</Request></Body>");
+
+	SHA1((unsigned char *)gold_request->body, strlen(gold_request->body),
+	     digest);	
+	gold_request->digest = encode_base64(digest, dlen);
+	HMAC(EVP_sha1(), gold_key, strlen(gold_key),
+	     digest, dlen, signature, &slen);
+	gold_request->signature = encode_base64(signature, slen);
+
+	xstrfmtcat(gold_msg,
+		   "<?xml version='1.0' encoding='UTF-8'?><Envelope>%s"
+		   "<Signature><DigestValue>%s</DigestValue>"
+		   "<SignatureValue>%s</SignatureValue>"
+		   "<SecurityToken type='Symmetric'></SecurityToken>"
+		   "</Signature></Envelope>",
+		   gold_request->body, gold_request->digest,
+		   gold_request->signature);
+	
+	snprintf(tmp_buff, sizeof(tmp_buff), "%X\r\n",
+		 (unsigned int)strlen(gold_msg));	
+
+	/* I wish gold could do persistant connections but it only
+	 * does one and then ends it so we have to do that also so
+	 * every time we start a connection we have to finish it.
+	 */
+	if(_start_communication() == SLURM_ERROR) 
+		return NULL;
+		
+	rc = _slurm_send_timeout(gold_fd, tmp_buff, strlen(tmp_buff),
+				 SLURM_PROTOCOL_NO_SEND_RECV_FLAGS,
+				 timeout);
+	
+	if (rc < 0) {
+		error("get_gold_response 1: _slurm_send_timeout: %m");
+		goto error;
+	}
+
+	debug2("sending %d '%s'", rc, gold_msg);
+
+	xstrcat(gold_msg, "0\r\n");
+	rc = _slurm_send_timeout(gold_fd, gold_msg, strlen(gold_msg),
+				 SLURM_PROTOCOL_NO_SEND_RECV_FLAGS,
+				 timeout);
+	if (rc < 0) {
+		error("get_gold_response 2: _slurm_send_timeout: %m");
+		goto error;
+	}
+	
+	xfree(gold_msg);
+	
+	/* we will always get this header 
+	 * HTTP/1.1 200 OK 17
+	 * Content-Type: text/xml; charset="utf-8" 42
+	 * Transfer-Encoding: chunked 28
+	 *  
+	 * which translates to 87 chars
+	 */ 
+	if(_slurm_recv_timeout(gold_fd, tmp_buff, 87, 0, timeout) < 0) {
+		error("get_gold_response: "
+		      "couldn't get the header of the message");
+		goto error;
+	}
+	debug5("got the header '%s'", tmp_buff);
+	
+	/* then get the size which is ended with '\r\n'
+	 */
+	i = 0;
+	while(read(gold_fd, &c, 1) > 0) {
+		if(c == '\r') {
+			read(gold_fd, &c, 1);
+			break;
+		}
+		tmp_buff[i++] = c; //////// getting command string
+		
+	}
+	tmp_buff[i] = '\0';
+	ret_len = xstrntol(tmp_buff, NULL, i, 16);
+		
+	debug3("got size %d", ret_len);
+	
+	gold_msg = xmalloc(ret_len+1);
+	
+	if(_slurm_recv_timeout(gold_fd, gold_msg, ret_len, 0, timeout) < 0) {
+		error("get_gold_response: "
+		      "couldn't get the message");
+		goto error;
+	}
+
+	debug2("got back '%s'", gold_msg);
+	if(_slurm_recv_timeout(gold_fd, tmp_buff, 3, 0, timeout) < 0) {
+		error("get_gold_response: "
+		      "couldn't get the end of the message");
+		goto error;
+	}
+	
+	gold_response = xmalloc(sizeof(gold_response_t));
+	gold_response->entries = list_create(destroy_gold_response_entry);
+	i = 0;
+	while(gold_msg[i]) {
+		if(!strncmp(gold_msg+i, "<Code>", 6)) {
+			i+=6;
+			gold_response->rc = atoi(gold_msg+i);
+		} else if(!strncmp(gold_msg+i, "<Count>", 7)) {
+			i+=7;
+			gold_response->entry_cnt = atoi(gold_msg+i);
+		} else if(!strncmp(gold_msg+i, "<Message>", 9)) {
+			int msg_end = 0;
+
+			i+=9;
+			msg_end = i;
+			while(gold_msg[msg_end] != '<') 
+				msg_end++;
+			
+			gold_response->message = 
+				xstrndup(gold_msg+i, msg_end-i);
+			i = msg_end + 10;
+		} else if(!strncmp(gold_msg+i, object, strlen(object))) {
+			gold_response_entry_t *resp_entry =
+				_create_response_entry(object, gold_msg, &i);
+			list_push(gold_response->entries, resp_entry);
+		}
+		i++;	
+	}
+	xfree(gold_msg);
+
+error:
+	/* I wish gold could do persistant connections but it only
+	 * does one and then ends it so we have to do that also so
+	 * every time we start a connection we have to finish it.
+	 */
+	_end_communication();
+
+	return gold_response;
+
+}
+
+extern int destroy_gold_response(gold_response_t *gold_response)
+{
+	if(gold_response) {
+		xfree(gold_response->message);
+		if(gold_response->entries) 
+			list_destroy(gold_response->entries);
+		
+		xfree(gold_response);
+	}
+	return SLURM_SUCCESS;
+}
+
+extern void destroy_gold_name_value(void *object)
+{
+	gold_name_value_t *name_val = (gold_name_value_t *)object;
+
+	if(name_val) {
+		xfree(name_val->name);
+		xfree(name_val->value);
+		xfree(name_val);
+	}
+}
+
+extern void destroy_gold_char(void *object)
+{
+	char *name_val = (char *)object;
+	xfree(name_val);
+}
+
+extern void destroy_gold_response_entry(void *object)
+{
+	gold_response_entry_t *resp_entry = (gold_response_entry_t *)object;
+
+	if(resp_entry) {
+		list_destroy(resp_entry->name_val);
+		xfree(resp_entry);
+	}
+}
+
diff --git a/src/plugins/jobacct/gold/gold_interface.h b/src/plugins/jobacct/gold/gold_interface.h
new file mode 100644
index 0000000000000000000000000000000000000000..5fedb9fdb73519c59c03a404c3e42d314dfde6db
--- /dev/null
+++ b/src/plugins/jobacct/gold/gold_interface.h
@@ -0,0 +1,138 @@
+/*****************************************************************************\
+ *  gold_interface.h - interface to the gold daemon commands.
+ *
+ *  $Id: storage_filetxt.c 10893 2007-01-29 21:53:48Z da $
+ *****************************************************************************
+ *  Copyright (C) 2004-2007 The Regents of the University of California.
+ *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
+ *  Written by Danny Auble <da@llnl.gov>
+ *  
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://www.llnl.gov/linux/slurm/>.
+ *  
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission 
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and 
+ *  distribute linked combinations including the two. You must obey the GNU 
+ *  General Public License in all respects for all of the code used other than 
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this 
+ *  exception to your version of the file(s), but you are not obligated to do 
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in 
+ *  the program, then also delete it here.
+ *  
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *  
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+\*****************************************************************************/
+#ifndef _HAVE_GOLD_INTERFACE_H
+#define _HAVE_GOLD_INTERFACE_H
+
+
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#if HAVE_STDINT_H
+#  include <stdint.h>
+#endif
+#if HAVE_INTTYPES_H
+#  include <inttypes.h>
+#endif
+
+#include <netdb.h>
+
+#include <stdio.h>
+#include <slurm/slurm_errno.h>
+
+#include "src/common/xmalloc.h"
+#include "src/common/list.h"
+#include "src/common/xstring.h"
+
+#define	GOLD_ACTION_QUERY_STR "Query"
+#define GOLD_ACTION_CREATE_STR "Create"
+#define GOLD_ACTION_MODIFY_STR "Modify"
+#define GOLD_ACTION_DELETE_STR "Delete"
+
+#define GOLD_OBJECT_ACCOUNT_STR "Account"
+#define GOLD_OBJECT_USER_STR "User"
+#define GOLD_OBJECT_PROJECT_STR "Project"
+#define GOLD_OBJECT_MACHINE_STR "Machine"
+#define GOLD_OBJECT_JOB_STR "Job"
+#define GOLD_OBJECT_ROLEUSER_STR "RoleUser"
+
+typedef enum {
+	GOLD_ACTION_QUERY,
+	GOLD_ACTION_CREATE,
+	GOLD_ACTION_MODIFY,
+	GOLD_ACTION_DELETE
+} gold_action_t;
+
+typedef enum {
+	GOLD_OBJECT_ACCOUNT,
+	GOLD_OBJECT_USER,
+	GOLD_OBJECT_PROJECT,
+	GOLD_OBJECT_MACHINE,
+	GOLD_OBJECT_JOB,
+	GOLD_OBJECT_ROLEUSER
+} gold_object_t;
+
+typedef struct {
+	char *name;
+	char *value;
+} gold_name_value_t;
+
+typedef struct {
+	gold_object_t object;
+	gold_action_t action;
+	List assignments; // List of gold_name_value_t's
+	List conditions; // List of gold_name_value_t's
+	List selections; // List of char *'s
+	char *body;
+	unsigned char *digest;
+	unsigned char *signature;
+} gold_request_t;
+
+typedef struct {
+	List name_val; // List of gold_name_value_t's
+} gold_response_entry_t;
+
+typedef struct {
+	List entries; // List of gold_response_entry_t's
+	int entry_cnt;
+	char *message;
+	int rc;
+} gold_response_t;
+
+
+extern int init_gold(char *machine, char *keyfile, char *host, uint16_t port);
+extern int fini_gold();
+
+extern gold_request_t *create_gold_request(gold_object_t object,
+					   gold_object_t action);
+extern int destroy_gold_request(gold_request_t *gold_request);
+
+extern int gold_request_add_assignment(gold_request_t *gold_request, 
+				       char *name, char *value);
+extern int gold_request_add_condition(gold_request_t *gold_request, 
+				      char *name, char *value);
+extern int gold_request_add_selection(gold_request_t *gold_request, char *name);
+
+extern gold_response_t *get_gold_response(gold_request_t *gold_request);
+extern int destroy_gold_response(gold_response_t *gold_response);
+
+extern void destroy_gold_name_value(void *object);
+extern void destroy_gold_char(void *object);
+extern void destroy_gold_response_entry(void *object);
+
+#endif
diff --git a/src/plugins/jobacct/gold/jobacct_gold.c b/src/plugins/jobacct/gold/jobacct_gold.c
new file mode 100644
index 0000000000000000000000000000000000000000..0f66b0afa6a9ef9d16cfa14dd57de1b8421989e4
--- /dev/null
+++ b/src/plugins/jobacct/gold/jobacct_gold.c
@@ -0,0 +1,555 @@
+/*****************************************************************************\
+ *  jobacct_gold.c - jobacct interface to gold.
+ *
+ *  $Id: jobacct_gold.c 12869 2007-12-20 17:22:25Z da $
+ *****************************************************************************
+ *  Copyright (C) 2004-2007 The Regents of the University of California.
+ *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
+ *  Written by Danny Auble <da@llnl.gov>
+ *  
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://www.llnl.gov/linux/slurm/>.
+ *  
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission 
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and 
+ *  distribute linked combinations including the two. You must obey the GNU 
+ *  General Public License in all respects for all of the code used other than 
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this 
+ *  exception to your version of the file(s), but you are not obligated to do 
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in 
+ *  the program, then also delete it here.
+ *  
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *  
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+\*****************************************************************************/
+#include "gold_interface.h"
+
+#include <stdlib.h>
+#include <ctype.h>
+
+#include "src/common/xmalloc.h"
+#include "src/common/list.h"
+#include "src/common/xstring.h"
+#include "src/common/uid.h"
+
+#include "src/slurmctld/slurmctld.h"
+#include "src/slurmd/slurmd/slurmd.h"
+#include "src/common/slurm_jobacct.h"
+#include "src/common/slurm_protocol_api.h"
+
+
+/*
+ * These variables are required by the generic plugin interface.  If they
+ * are not found in the plugin, the plugin loader will ignore it.
+ *
+ * plugin_name - a string giving a human-readable description of the
+ * plugin.  There is no maximum length, but the symbol must refer to
+ * a valid string.
+ *
+ * plugin_type - a string suggesting the type of the plugin or its
+ * applicability to a particular form of data or method of data handling.
+ * If the low-level plugin API is used, the contents of this string are
+ * unimportant and may be anything.  SLURM uses the higher-level plugin
+ * interface which requires this string to be of the form
+ *
+ *	<application>/<method>
+ *
+ * where <application> is a description of the intended application of
+ * the plugin (e.g., "jobacct" for SLURM job completion logging) and <method>
+ * is a description of how this plugin satisfies that application.  SLURM will
+ * only load job completion logging plugins if the plugin_type string has a 
+ * prefix of "jobacct/".
+ *
+ * plugin_version - an unsigned 32-bit integer giving the version number
+ * of the plugin.  If major and minor revisions are desired, the major
+ * version number may be multiplied by a suitable magnitude constant such
+ * as 100 or 1000.  Various SLURM versions will likely require a certain
+ * minimum versions for their plugins as the job accounting API 
+ * matures.
+ */
+const char plugin_name[] = "Job accounting GOLD plugin";
+const char plugin_type[] = "jobacct/gold";
+const uint32_t plugin_version = 100;
+
+/* for this first draft we are only supporting one cluster per slurm
+ * 1.3 will probably do better than this.
+ */
+
+static char *cluster_name = NULL;
+
+/* _check_for_job 
+ * IN jobid - job id to check for 
+ * IN submit - timestamp for submit time of job
+ * RET 0 for not found 1 for found
+ */
+
+static int _check_for_job(uint32_t jobid, time_t submit) 
+{
+	gold_request_t *gold_request = create_gold_request(GOLD_OBJECT_JOB,
+							   GOLD_ACTION_QUERY);
+	gold_response_t *gold_response = NULL;
+	char tmp_buff[50];
+	int rc = 0;
+
+	if(!gold_request) 
+		return rc;
+
+	gold_request_add_selection(gold_request, "JobId");
+
+	snprintf(tmp_buff, sizeof(tmp_buff), "%u", jobid);
+	gold_request_add_condition(gold_request, "JobId", tmp_buff);
+
+	snprintf(tmp_buff, sizeof(tmp_buff), "%u", (int)submit);
+	gold_request_add_condition(gold_request, "SubmitTime", tmp_buff);
+
+	gold_response = get_gold_response(gold_request);
+	destroy_gold_request(gold_request);
+
+	if(!gold_response) {
+		error("_check_for_job: no response received");
+		return 0;
+	}
+
+	if(gold_response->entry_cnt > 0) 
+		rc = 1;
+	destroy_gold_response(gold_response);
+	
+	return rc;
+}
+
+static char *_get_account_id(char *user, char *project, char *machine)
+{
+	gold_request_t *gold_request = create_gold_request(GOLD_OBJECT_ACCOUNT,
+							   GOLD_ACTION_QUERY);
+	gold_response_t *gold_response = NULL;
+	char *gold_account_id = NULL;
+	gold_response_entry_t *resp_entry = NULL;
+	gold_name_value_t *name_val = NULL;
+
+	gold_request_add_selection(gold_request, "Id");
+	gold_request_add_condition(gold_request, "User", user);
+	if(project)
+		gold_request_add_condition(gold_request, "Project", project);
+	gold_request_add_condition(gold_request, "Machine", machine);
+		
+	gold_response = get_gold_response(gold_request);
+	destroy_gold_request(gold_request);
+
+	if(!gold_response) {
+		error("_get_account_id: no response received");
+		return NULL;
+	}
+
+	if(gold_response->entry_cnt > 0) {
+		resp_entry = list_pop(gold_response->entries);
+		name_val = list_pop(resp_entry->name_val);
+
+		gold_account_id = xstrdup(name_val->value);
+
+		destroy_gold_name_value(name_val);
+		destroy_gold_response_entry(resp_entry);
+	} else {
+		error("no account found returning 0");
+		gold_account_id = xstrdup("0");
+	}
+
+	destroy_gold_response(gold_response);
+
+	return gold_account_id;
+}
+
+static int _add_edit_job(struct job_record *job_ptr, gold_object_t action)
+{
+	gold_request_t *gold_request = create_gold_request(GOLD_OBJECT_JOB,
+							   action);
+	gold_response_t *gold_response = NULL;
+	char tmp_buff[50];
+	int rc = SLURM_ERROR;
+	char *gold_account_id = NULL;
+	char *user = uid_to_string((uid_t)job_ptr->user_id);
+	char *jname = NULL;
+	int ncpus=0, tmp = 0, i = 0;
+	char *account = NULL;
+	char *nodes = "(null)";
+
+	if(!gold_request) 
+		return rc;
+
+	if ((tmp = strlen(job_ptr->name))) {
+		jname = xmalloc(++tmp);
+		for (i=0; i<tmp; i++) {
+			if (isspace(job_ptr->name[i]))
+				jname[i]='_';
+			else
+				jname[i]=job_ptr->name[i];
+		}
+	} else
+		jname = xstrdup("allocation");
+	
+	if (job_ptr->account && job_ptr->account[0])
+		account = job_ptr->account;
+	
+	if (job_ptr->nodes && job_ptr->nodes[0])
+		nodes = job_ptr->nodes;
+	
+	for (i=0; i < job_ptr->num_cpu_groups; i++) {
+		ncpus += (job_ptr->cpus_per_node[i])
+			* (job_ptr->cpu_count_reps[i]);
+		//info("got %d from %d * %d", ncpus, job_ptr->cpus_per_node[i],
+		//   job_ptr->cpu_count_reps[i]);
+	}
+//info("total procs is  %d", job_ptr->details->total_procs);
+	if(action == GOLD_ACTION_CREATE) {
+		snprintf(tmp_buff, sizeof(tmp_buff), "%u", job_ptr->job_id);
+		gold_request_add_assignment(gold_request, "JobId", tmp_buff);
+		
+		gold_account_id = _get_account_id(user, account, 
+						  cluster_name);
+
+		gold_request_add_assignment(gold_request, "GoldAccountId",
+					    gold_account_id);
+		xfree(gold_account_id);
+
+		snprintf(tmp_buff, sizeof(tmp_buff), "%u",
+			 (int)job_ptr->details->submit_time);
+		gold_request_add_assignment(gold_request, "SubmitTime",
+					    tmp_buff);
+
+	} else if (action == GOLD_ACTION_MODIFY) {
+		snprintf(tmp_buff, sizeof(tmp_buff), "%u", job_ptr->job_id);
+		gold_request_add_condition(gold_request, "JobId", tmp_buff);
+		
+		snprintf(tmp_buff, sizeof(tmp_buff), "%u",
+			 (int)job_ptr->details->submit_time);
+		gold_request_add_condition(gold_request, "SubmitTime",
+					   tmp_buff);
+								
+		snprintf(tmp_buff, sizeof(tmp_buff), "%u",
+			 (int)job_ptr->end_time);
+		gold_request_add_assignment(gold_request, "EndTime",
+					    tmp_buff);		
+		
+		snprintf(tmp_buff, sizeof(tmp_buff), "%u",
+			 (int)job_ptr->exit_code);
+		gold_request_add_assignment(gold_request, "ExitCode",
+					    tmp_buff);
+
+	} else {
+		destroy_gold_request(gold_request);
+		error("_add_edit_job: bad action given %d", action);		
+		return rc;
+	}
+
+	gold_request_add_assignment(gold_request, "Partition",
+				    job_ptr->partition);
+	
+	snprintf(tmp_buff, sizeof(tmp_buff), "%u", job_ptr->num_procs);
+	gold_request_add_assignment(gold_request, "RequestedCPUS",
+				    tmp_buff);
+	snprintf(tmp_buff, sizeof(tmp_buff), "%u", ncpus);
+	gold_request_add_assignment(gold_request, "AllocatedCPUS",
+				    tmp_buff);
+
+	gold_request_add_assignment(gold_request, "NodeList",
+				    nodes);
+
+	gold_request_add_assignment(gold_request, "JobName",
+				    jname);
+	xfree(jname);
+
+/* 	gold_request_add_assignment(gold_request, "CPUSecondsReserved", */
+/* 	     		            ); */
+
+
+	snprintf(tmp_buff, sizeof(tmp_buff), "%u",
+		 (int)job_ptr->details->begin_time);
+	gold_request_add_assignment(gold_request, "EligibleTime",
+				    tmp_buff);
+
+	snprintf(tmp_buff, sizeof(tmp_buff), "%u",
+		 (int)job_ptr->start_time);
+	gold_request_add_assignment(gold_request, "StartTime",
+				    tmp_buff);
+		
+	snprintf(tmp_buff, sizeof(tmp_buff), "%u",
+		 job_ptr->job_state & (~JOB_COMPLETING));
+	gold_request_add_assignment(gold_request, "State",
+				    tmp_buff);
+
+	
+
+	gold_response = get_gold_response(gold_request);	
+	destroy_gold_request(gold_request);
+
+	if(!gold_response) {
+		error("_add_edit_job: no response received");
+		return rc;
+	}
+
+	if(!gold_response->rc) 
+		rc = SLURM_SUCCESS;
+	else {
+		error("gold_response has non-zero rc(%d): %s",
+		      gold_response->rc,
+		      gold_response->message);
+	}
+	destroy_gold_response(gold_response);
+
+	return rc;
+}
+
+/*
+ * init() is called when the plugin is loaded, before any other functions
+ * are called.  Put global initialization here.
+ */
+extern int init ( void )
+{
+	verbose("%s loaded", plugin_name);
+	return SLURM_SUCCESS;
+}
+
+extern int fini ( void )
+{
+	return SLURM_SUCCESS;
+}
+
+/*
+ * The following routines are called by slurmctld
+ */
+
+/*
+ * The following routines are called by slurmd
+ */
+int jobacct_p_init_struct(struct jobacctinfo *jobacct, 
+			  jobacct_id_t *jobacct_id)
+{
+	return SLURM_SUCCESS;
+}
+
+struct jobacctinfo *jobacct_p_alloc(jobacct_id_t *jobacct_id)
+{
+	return NULL;
+}
+
+void jobacct_p_free(struct jobacctinfo *jobacct)
+{
+	return;
+}
+
+int jobacct_p_setinfo(struct jobacctinfo *jobacct, 
+		      enum jobacct_data_type type, void *data)
+{
+	return SLURM_SUCCESS;
+	
+}
+
+int jobacct_p_getinfo(struct jobacctinfo *jobacct, 
+		      enum jobacct_data_type type, void *data)
+{
+	return SLURM_SUCCESS;
+}
+
+void jobacct_p_aggregate(struct jobacctinfo *dest, struct jobacctinfo *from)
+{
+	return;
+}
+
+void jobacct_p_2_sacct(sacct_t *sacct, struct jobacctinfo *jobacct)
+{
+	return;
+}
+
+void jobacct_p_pack(struct jobacctinfo *jobacct, Buf buffer)
+{
+	return;
+}
+
+int jobacct_p_unpack(struct jobacctinfo **jobacct, Buf buffer)
+{
+	return SLURM_SUCCESS;
+}
+
+
+int jobacct_p_init_slurmctld(char *gold_info)
+{
+	char *total = "localhost:/etc/gold/auth_key:localhost:7112";
+	int found = 0;
+	int i=0, j=0;
+	char *host = NULL;
+	char *keyfile = NULL;
+	uint16_t port = 0;
+
+	debug2("jobacct_init() called");
+	if(gold_info) 
+		total = gold_info;
+	i = 0;
+	while(total[j]) {
+		if(total[j] == ':') {
+			switch(found) {
+			case 0: // cluster_name name
+			        cluster_name = xstrndup(total+i, j-i);
+				break;
+			case 1: // keyfile name
+				keyfile = xstrndup(total+i, j-i);
+				break;
+			case 2: // host name
+				host = xstrndup(total+i, j-i);
+				break;
+			case 3: // port
+				port = atoi(total+i);
+				break;
+			}
+			found++;
+			i = j+1;	
+		}
+		j++;
+	}
+	if(!port) 
+		port = atoi(total+i);
+
+	if(!cluster_name)
+		fatal("JobAcctLogfile should be in the format of "
+		      "cluster_name:gold_auth_key_file_path:"
+		      "goldd_host:goldd_port "
+		      "bad cluster_name");
+	if (!keyfile || *keyfile != '/')
+		fatal("JobAcctLogfile should be in the format of "
+		      "cluster_name:gold_auth_key_file_path:"
+		      "goldd_host:goldd_port "
+		      "bad key file");
+	if(!host)
+		fatal("JobAcctLogfile should be in the format of "
+		      "cluster_name:gold_auth_key_file_path:"
+		      "goldd_host:goldd_port "
+		      "bad host");
+	if(!port) 
+		fatal("JobAcctLogfile should be in the format of "
+		      "cluster_name:gold_auth_key_file_path:"
+		      "goldd_host:goldd_port "
+		      "bad port");
+	
+	debug2("connecting from %s to gold with keyfile='%s' for %s(%d)",
+	       cluster_name, keyfile, host, port);
+
+	init_gold(cluster_name, keyfile, host, port);
+		
+	xfree(keyfile);
+	xfree(host);
+
+	return SLURM_SUCCESS;
+}
+
+int jobacct_p_fini_slurmctld()
+{
+	xfree(cluster_name);
+	fini_gold();
+	return SLURM_SUCCESS;
+}
+
+int jobacct_p_job_start_slurmctld(struct job_record *job_ptr)
+{
+	gold_object_t action = GOLD_ACTION_CREATE;
+	
+	if(_check_for_job(job_ptr->job_id, job_ptr->details->submit_time)) {
+		error("It looks like this job is already in GOLD.  "
+		      "This shouldn't happen, we are going to overwrite "
+		      "old info.");
+		action = GOLD_ACTION_MODIFY;
+	}
+
+	return _add_edit_job(job_ptr, action);
+}
+
+int jobacct_p_job_complete_slurmctld(struct job_record *job_ptr) 
+{
+	gold_object_t action = GOLD_ACTION_MODIFY;
+	
+	if(!_check_for_job(job_ptr->job_id, job_ptr->details->submit_time)) {
+		error("Couldn't find this job entry.  "
+		      "This shouldn't happen, we are going to create one.");
+		action = GOLD_ACTION_CREATE;
+	}
+
+	return _add_edit_job(job_ptr, action);
+}
+
+int jobacct_p_step_start_slurmctld(struct step_record *step)
+{
+	gold_object_t action = GOLD_ACTION_MODIFY;
+	
+	if(!_check_for_job(step->job_ptr->job_id,
+			   step->job_ptr->details->submit_time)) {
+		error("Couldn't find this job entry.  "
+		      "This shouldn't happen, we are going to create one.");
+		action = GOLD_ACTION_CREATE;
+	}
+
+	return _add_edit_job(step->job_ptr, action);
+
+}
+
+int jobacct_p_step_complete_slurmctld(struct step_record *step)
+{
+	return SLURM_SUCCESS;	
+}
+
+int jobacct_p_suspend_slurmctld(struct job_record *job_ptr)
+{
+	return SLURM_SUCCESS;
+}
+
+int jobacct_p_startpoll(int frequency)
+{
+	info("jobacct GOLD plugin loaded");
+	debug3("slurmd_jobacct_init() called");
+	
+	return SLURM_SUCCESS;
+}
+
+int jobacct_p_endpoll()
+{
+	return SLURM_SUCCESS;
+}
+
+int jobacct_p_set_proctrack_container_id(uint32_t id)
+{
+	return SLURM_SUCCESS;
+}
+
+int jobacct_p_add_task(pid_t pid, jobacct_id_t *jobacct_id)
+{
+	return SLURM_SUCCESS;
+}
+
+struct jobacctinfo *jobacct_p_stat_task(pid_t pid)
+{
+	return NULL;
+}
+
+struct jobacctinfo *jobacct_p_remove_task(pid_t pid)
+{
+	return NULL;
+}
+
+void jobacct_p_suspend_poll()
+{
+	return;
+}
+
+void jobacct_p_resume_poll()
+{
+	return;
+}
diff --git a/src/plugins/jobacct/none/jobacct_none.c b/src/plugins/jobacct/none/jobacct_none.c
index 4cbc72dc993be97a261cf55c382d279d540e75a1..49178f6016ff25d234ad7075e182a0aaa99958c3 100644
--- a/src/plugins/jobacct/none/jobacct_none.c
+++ b/src/plugins/jobacct/none/jobacct_none.c
@@ -158,6 +158,7 @@ void jobacct_p_pack(struct jobacctinfo *jobacct, Buf buffer)
 
 int jobacct_p_unpack(struct jobacctinfo **jobacct, Buf buffer)
 {
+	*jobacct = NULL;
 	return SLURM_SUCCESS;
 }
 
diff --git a/src/plugins/mpi/mvapich/mvapich.c b/src/plugins/mpi/mvapich/mvapich.c
index 96784b0b7c7a3c80d1bee5f288fe7d242bfb0b63..ac07bedab2c97337be5d166b0b1a3cf2c8124b8a 100644
--- a/src/plugins/mpi/mvapich/mvapich.c
+++ b/src/plugins/mpi/mvapich/mvapich.c
@@ -836,8 +836,7 @@ mvapich_print_abort_message (mvapich_state_t *st, int rank,
 		msglen = 0;
 	}
 
-	host = slurm_step_layout_host_name(
-		sl, slurm_step_layout_host_id(sl, rank));
+	host = slurm_step_layout_host_name (sl, rank);
 
 	if (dest >= 0) {
 		const char *dsthost = slurm_step_layout_host_name (sl, dest);
@@ -855,10 +854,9 @@ mvapich_print_abort_message (mvapich_state_t *st, int rank,
 				st->job->jobid, st->job->stepid, 
 				rank, host, dest, dsthost, msgstr);
 		closelog();
-	}
-	else {
+	} else {
 		info ("mvapich: %M: ABORT from MPI rank %d [on %s]", 
-				rank, host);
+		      rank, host);
 		/*
 		 *  Log the abort event to syslog
 		 *   so that system administrators know about possible HW events.
diff --git a/src/plugins/sched/wiki/cancel_job.c b/src/plugins/sched/wiki/cancel_job.c
index 601f1f7fbb32f2b0bc1701e29766fe3a1b7db211..ec392bbdd9036bdb6636a30ef399576c04c386c4 100644
--- a/src/plugins/sched/wiki/cancel_job.c
+++ b/src/plugins/sched/wiki/cancel_job.c
@@ -113,7 +113,7 @@ static int	_cancel_job(uint32_t jobid, int *err_code, char **err_msg)
 		goto fini;
 	}
 
-	debug("wiki: cancel job %u", jobid);
+	info("wiki: cancel job %u", jobid);
 
  fini:	unlock_slurmctld(job_write_lock);
 	return rc;
diff --git a/src/plugins/sched/wiki2/cancel_job.c b/src/plugins/sched/wiki2/cancel_job.c
index 3a414769063d0bd6138c0b16bd72367606f049e3..26584cccd1d6f0fac8fc6c2ced128bef72c4e611 100644
--- a/src/plugins/sched/wiki2/cancel_job.c
+++ b/src/plugins/sched/wiki2/cancel_job.c
@@ -114,7 +114,7 @@ static int	_cancel_job(uint32_t jobid, int *err_code, char **err_msg)
 		goto fini;
 	}
 
-	debug("wiki: cancel job %u", jobid);
+	info("wiki: cancel job %u", jobid);
 
  fini:	unlock_slurmctld(job_write_lock);
 	return rc;
diff --git a/src/plugins/sched/wiki2/job_modify.c b/src/plugins/sched/wiki2/job_modify.c
index e3a62654951e8e3241d248157ca37ac629aa2c60..806106c3aa38041dda32bb628ba7051b92a3b451 100644
--- a/src/plugins/sched/wiki2/job_modify.c
+++ b/src/plugins/sched/wiki2/job_modify.c
@@ -72,9 +72,10 @@ static int32_t _get_depend_id(char *str)
 static int	_job_modify(uint32_t jobid, char *bank_ptr, 
 			int32_t depend_id, char *new_hostlist,
 			uint32_t new_node_cnt, char *part_name_ptr, 
-			uint32_t new_time_limit)
+			uint32_t new_time_limit, char *name_ptr)
 {
 	struct job_record *job_ptr;
+	time_t now = time(NULL);
 
 	job_ptr = find_job_record(jobid);
 	if (job_ptr == NULL) {
@@ -101,13 +102,19 @@ static int	_job_modify(uint32_t jobid, char *bank_ptr,
 		job_ptr->end_time = job_ptr->end_time +
 				((job_ptr->time_limit -
 				  old_time) * 60);
-		last_job_update = time(NULL);
+		last_job_update = now;
 	}
 	if (bank_ptr) {
 		info("wiki: change job %u bank %s", jobid, bank_ptr);
 		xfree(job_ptr->account);
 		job_ptr->account = xstrdup(bank_ptr);
-		last_job_update = time(NULL);
+		last_job_update = now;
+	}
+
+	if (name_ptr) {
+		info("wiki: change job %u name %s", jobid, name_ptr);
+		strncpy(job_ptr->name, name_ptr, sizeof(job_ptr->name));
+		last_job_update = now;
 	}
 
 	if (new_hostlist) {
@@ -176,7 +183,7 @@ host_fini:	if (rc) {
 			jobid, part_name_ptr);
 		strncpy(job_ptr->partition, part_name_ptr, MAX_SLURM_NAME);
 		job_ptr->part_ptr = part_ptr;
-		last_job_update = time(NULL);
+		last_job_update = now;
 	}
 
 	if (new_node_cnt) {
@@ -187,7 +194,7 @@ host_fini:	if (rc) {
 				job_ptr->details->max_nodes = new_node_cnt;
 			info("wiki: change job %u min_nodes to %u",
 				jobid, new_node_cnt);
-			last_job_update = time(NULL);
+			last_job_update = now;
 		} else {
 			error("wiki: MODIFYJOB node count of non-pending "
 				"job %u", jobid);
@@ -205,8 +212,8 @@ host_fini:	if (rc) {
 extern int	job_modify_wiki(char *cmd_ptr, int *err_code, char **err_msg)
 {
 	char *arg_ptr, *bank_ptr, *depend_ptr, *nodes_ptr;
-	char *host_ptr, *part_ptr, *time_ptr, *tmp_char;
-	int slurm_rc;
+	char *host_ptr, *name_ptr, *part_ptr, *time_ptr, *tmp_char;
+	int i, slurm_rc;
 	int depend_id = -1;
 	uint32_t jobid, new_node_cnt = 0, new_time_limit = 0;
 	static char reply_msg[128];
@@ -234,6 +241,7 @@ extern int	job_modify_wiki(char *cmd_ptr, int *err_code, char **err_msg)
 	}
 	bank_ptr   = strstr(cmd_ptr, "BANK=");
 	depend_ptr = strstr(cmd_ptr, "DEPEND=");
+	name_ptr   = strstr(cmd_ptr, "JOBNAME=");
 	host_ptr   = strstr(cmd_ptr, "HOSTLIST=");
 	nodes_ptr  = strstr(cmd_ptr, "NODES=");
 	part_ptr   = strstr(cmd_ptr, "PARTITION=");
@@ -258,7 +266,37 @@ extern int	job_modify_wiki(char *cmd_ptr, int *err_code, char **err_msg)
 	if (host_ptr) {
 		host_ptr[8] = ':';
 		host_ptr += 9;
-		_null_term(bank_ptr);
+		_null_term(host_ptr);
+	}
+	if (name_ptr) {
+		name_ptr[7] = ':';
+		name_ptr += 8;
+		if (name_ptr[0] == '\"') {
+			name_ptr++;
+			for (i=0; i<MAX_JOBNAME_LEN; i++) {
+				if (name_ptr[i] == '\0')
+					break;
+				if (name_ptr[i] == '\"') {
+					name_ptr[i] = '\0';
+					break;
+				}
+			}
+			if (i == MAX_JOBNAME_LEN)
+				name_ptr[i-1] = '\0';
+		} else if (name_ptr[0] == '\'') {
+			name_ptr++;
+			for (i=0; i<MAX_JOBNAME_LEN; i++) {
+				if (name_ptr[i] == '\0')
+					break;
+				if (name_ptr[i] == '\'') {
+					name_ptr[i] = '\0';
+					break;
+				}
+			}
+			if (i == MAX_JOBNAME_LEN)
+				name_ptr[i-1] = '\0';
+		} else
+			_null_term(name_ptr);
 	}
 	if (nodes_ptr) {
 		nodes_ptr[5] = ':';
@@ -287,7 +325,7 @@ extern int	job_modify_wiki(char *cmd_ptr, int *err_code, char **err_msg)
 
 	lock_slurmctld(job_write_lock);
 	slurm_rc = _job_modify(jobid, bank_ptr, depend_id, host_ptr,
-			new_node_cnt, part_ptr, new_time_limit);
+			new_node_cnt, part_ptr, new_time_limit, name_ptr);
 	unlock_slurmctld(job_write_lock);
 	if (slurm_rc != SLURM_SUCCESS) {
 		*err_code = -700;
diff --git a/src/plugins/sched/wiki2/job_requeue.c b/src/plugins/sched/wiki2/job_requeue.c
index 147d75e70c5b02612d8ac5c86b85ba57ab6130ac..ce0bd142a7a08deaf04b42a85c4ae7a8fd7ec323 100644
--- a/src/plugins/sched/wiki2/job_requeue.c
+++ b/src/plugins/sched/wiki2/job_requeue.c
@@ -78,6 +78,7 @@ extern int	job_requeue_wiki(char *cmd_ptr, int *err_code, char **err_msg)
 			FREE_NULL_BITMAP(job_ptr->details->
 					 req_node_bitmap);
 		}
+		info("wiki: requeued job %u", jobid);
 	} else {
 		*err_code = -700;
 		*err_msg = slurm_strerror(slurm_rc);
diff --git a/src/plugins/select/bluegene/plugin/sfree.c b/src/plugins/select/bluegene/plugin/sfree.c
index e84bd3b49f5b22d54fa2888fe55938bed0cc3db0..98c41d2b06275116982c80b4a434377bdba9b464 100644
--- a/src/plugins/select/bluegene/plugin/sfree.c
+++ b/src/plugins/select/bluegene/plugin/sfree.c
@@ -1,6 +1,6 @@
 /*****************************************************************************\
  *  sfree.c - free specified block or all blocks.
- *  $Id: sfree.c 10574 2006-12-15 23:38:29Z jette $
+ *  $Id: sfree.c 12858 2007-12-19 20:15:32Z da $
  *****************************************************************************
  *  Copyright (C) 2004 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -113,7 +113,10 @@ int main(int argc, char *argv[])
 	
 	bridge_init();
 	if (!have_db2) {
-		printf("must be on BG SN to resolve.\n");
+		error("Required libraries can not be found "
+		       "to access the Bluegene system.\nPlease "
+		       "set your LD_LIBRARY_PATH correctly to "
+		       "point to them.");
 		exit(0);
 	}
 
diff --git a/src/plugins/switch/federation/federation.c b/src/plugins/switch/federation/federation.c
index aa0a8d37c8796a418950f38435e3c6d9c1276c3a..f741b44f7d50aa02d40333c7eae48ba5942a7d0a 100644
--- a/src/plugins/switch/federation/federation.c
+++ b/src/plugins/switch/federation/federation.c
@@ -1,6 +1,6 @@
 /*****************************************************************************\
  **  federation.c - Library routines for initiating jobs on IBM Federation
- **  $Id: federation.c 12618 2007-11-02 22:31:39Z jette $
+ **  $Id: federation.c 12736 2007-11-29 21:53:34Z jette $
  *****************************************************************************
  *  Copyright (C) 2004 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -2254,7 +2254,7 @@ _check_rdma_job_count(char *adapter)
 
 	rc = ntbl_rdma_jobs(NTBL_VERSION, adapter,
 			    &job_count, &job_keys);
-	if (rc != NTBL_SUCESSS) {
+	if (rc != NTBL_SUCCESS) {
 		error("ntbl_rdma_jobs(): %d", rc);
 		return SLURM_ERROR;
 	}
diff --git a/src/sbatch/opt.c b/src/sbatch/opt.c
index ecdffd4538709179825a5620c8f165e0f30f87aa..82633fa422d69808094505e26d9f5a7e36fc6c18 100644
--- a/src/sbatch/opt.c
+++ b/src/sbatch/opt.c
@@ -85,6 +85,7 @@
 #define OPT_OVERCOMMIT	0x11
 
 /* generic getopt_long flags, integers and *not* valid characters */
+#define LONG_OPT_PROPAGATE   0x100
 #define LONG_OPT_JOBID       0x105
 #define LONG_OPT_TMP         0x106
 #define LONG_OPT_MEM         0x107
@@ -444,6 +445,8 @@ static void _opt_default()
 	opt.euid	    = (uid_t) -1;
 	opt.egid	    = (gid_t) -1;
 	
+	opt.propagate	    = NULL;  /* propagate specific rlimits */
+
 	opt.ifname = xstrdup("/dev/null");
 	opt.ofname = NULL;
 	opt.efname = NULL;
@@ -661,6 +664,7 @@ static struct option long_options[] = {
 	{"ntasks-per-node", required_argument,0,LONG_OPT_TASKSPERNODE}, 
 	{"wrap",          required_argument, 0, LONG_OPT_WRAP},
 	{"get-user-env",  optional_argument, 0, LONG_OPT_GET_USER_ENV},
+	{"propagate",     optional_argument, 0, LONG_OPT_PROPAGATE},
 	{NULL,            0,                 0, 0}
 };
 
@@ -1304,6 +1308,13 @@ static void _set_options(int argc, char **argv)
 			else
 				opt.get_user_env_time = 0;
 			break;
+		case LONG_OPT_PROPAGATE:
+			xfree(opt.propagate);
+			if (optarg)
+				opt.propagate = xstrdup(optarg);
+			else
+				opt.propagate = xstrdup("ALL");
+			break;
 		default:
 			fatal("Unrecognized command line parameter %c",
 			      opt_char);
@@ -1791,6 +1802,11 @@ static bool _opt_verify(void)
 		xfree(sched_name);
 	}
 
+	if (opt.propagate && parse_rlimits( opt.propagate, PROPAGATE_RLIMITS)) {
+		error( "--propagate=%s is not valid.", opt.propagate );
+		verified = false;
+	}
+
 	return verified;
 }
 
@@ -2118,6 +2134,8 @@ static void _opt_list()
 	info("mail_type      : %s", _print_mail_type(opt.mail_type));
 	info("mail_user      : %s", opt.mail_user);
 	info("tasks-per-node : %d", opt.tasks_per_node);
+	info("propagate      : %s",
+	     opt.propagate == NULL ? "NONE" : opt.propagate);
 	str = print_commandline();
 	info("remote command : `%s'", str);
 	xfree(str);
@@ -2142,7 +2160,7 @@ static void _usage(void)
 "              [--mloader-image=path] [--ramdisk-image=path]\n"
 #endif
 "              [--mail-type=type] [--mail-user=user][--nice[=value]]\n"
-"              [--no-requeue] [--ntasks-per-node=n]\n"
+"              [--no-requeue] [--ntasks-per-node=n] [--propagate]\n"
 "              [--nodefile=file] [--nodelist=hosts] [--exclude=hosts]\n"
 "              executable [args...]\n");
 }
@@ -2184,6 +2202,7 @@ static void _help(void)
 "      --uid=user_id           user ID to run job as (user root only)\n"
 "      --get-user-env          used by Moab.  See srun man page.\n"
 "      --no-requeue            if set, do not permit the job to be requeued\n"
+"      --propagate[=rlimits]   propagate all [or specific list of] rlimits\n"
 "\n"
 "Constraint options:\n"
 "      --mincpus=n             minimum number of cpus per node\n"
diff --git a/src/sbatch/opt.h b/src/sbatch/opt.h
index 9591a83869a1b5c93bf4616e169d3d4690230f4d..52a2feaae92209cb968801caa41f1823c03405ab 100644
--- a/src/sbatch/opt.h
+++ b/src/sbatch/opt.h
@@ -1,6 +1,6 @@
 /*****************************************************************************\
  *  opt.h - definitions for srun option processing
- *  $Id: opt.h 12697 2007-11-27 22:02:29Z jette $
+ *  $Id: opt.h 12856 2007-12-19 00:18:44Z jette $
  *****************************************************************************
  *  Copyright (C) 2002-2006 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -74,6 +74,7 @@ typedef struct sbatch_options {
 	int nice;		/* --nice			*/
 	char *account;		/* --account, -U acct_name	*/
 	char *comment;		/* --comment			*/
+	char *propagate;	/* --propagate[=RLIMIT_CORE,...]*/
 
 	int immediate;		/* -i, --immediate      	*/
 
diff --git a/src/sbatch/sbatch.c b/src/sbatch/sbatch.c
index b5b340cda91387498e3eeee7afcb114b8dc61562..2fd84f78dd8eaaae998df5162709fc14ef6be174 100644
--- a/src/sbatch/sbatch.c
+++ b/src/sbatch/sbatch.c
@@ -1,7 +1,7 @@
 /*****************************************************************************\
  *  sbatch.c - Submit a SLURM batch script.
  *
- *  $Id: sbatch.c 12700 2007-11-27 23:39:24Z jette $
+ *  $Id: sbatch.c 12856 2007-12-19 00:18:44Z jette $
  *****************************************************************************
  *  Copyright (C) 2006 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -40,19 +40,22 @@
 
 #include <slurm/slurm.h>
 
+#include "src/common/env.h"
+#include "src/common/read_config.h"
+#include "src/common/slurm_rlimits_info.h"
 #include "src/common/xstring.h"
 #include "src/common/xmalloc.h"
-#include "src/common/env.h"
 
 #include "src/sbatch/opt.h"
 
 #define MAX_RETRIES 3
 
-static int fill_job_desc_from_opts(job_desc_msg_t *desc);
+static int   fill_job_desc_from_opts(job_desc_msg_t *desc);
 static void *get_script_buffer(const char *filename, int *size);
 static void  set_prio_process_env(void);
 static int   set_umask_env(void);
 static char *script_wrap(char *command_string);
+static int  _set_rlimit_env(void);
 
 int main(int argc, char *argv[])
 {
@@ -87,6 +90,7 @@ int main(int argc, char *argv[])
 		fatal("sbatch parameter parsing");
 	}
 
+	(void) _set_rlimit_env();
 	set_prio_process_env();
 	set_umask_env();
 	slurm_init_job_desc_msg(&desc);
@@ -402,3 +406,59 @@ static char *script_wrap(char *command_string)
 
 	return script;
 }
+
+/* Set SLURM_RLIMIT_* environment variables with current resource 
+ * limit values, reset RLIMIT_NOFILE to maximum possible value */
+static int _set_rlimit_env(void)
+{
+	int                  rc = SLURM_SUCCESS;
+	struct rlimit        rlim[1];
+	unsigned long        cur;
+	char                 name[64], *format;
+	slurm_rlimits_info_t *rli;
+
+	/* Load default limits to be propagated from slurm.conf */
+	slurm_conf_lock();
+	slurm_conf_unlock();
+
+	for (rli = get_slurm_rlimits_info(); rli->name != NULL; rli++ ) {
+
+		if (getrlimit (rli->resource, rlim) < 0) {
+			error ("getrlimit (RLIMIT_%s): %m", rli->name);
+			rc = SLURM_FAILURE;
+			continue;
+		}
+		
+		cur = (unsigned long) rlim->rlim_cur;
+		snprintf(name, sizeof(name), "SLURM_RLIMIT_%s", rli->name);
+		if (opt.propagate && rli->propagate_flag == PROPAGATE_RLIMITS)
+			/*
+			 * Prepend 'U' to indicate user requested propagate
+			 */
+			format = "U%lu";
+		else
+			format = "%lu";
+		
+		if (setenvf (NULL, name, format, cur) < 0) {
+			error ("unable to set %s in environment", name);
+			rc = SLURM_FAILURE;
+			continue;
+		}
+		
+		debug ("propagating RLIMIT_%s=%lu", rli->name, cur);
+	}
+
+	/* 
+	 *  Now increase NOFILE to the max available for this srun
+	 */
+	if (getrlimit (RLIMIT_NOFILE, rlim) < 0)
+	 	return (error ("getrlimit (RLIMIT_NOFILE): %m"));
+
+	if (rlim->rlim_cur < rlim->rlim_max) {
+		rlim->rlim_cur = rlim->rlim_max;
+		if (setrlimit (RLIMIT_NOFILE, rlim) < 0) 
+			return (error ("Unable to increase max no. files: %m"));
+	}
+
+	return rc;
+}
diff --git a/src/slurmctld/controller.c b/src/slurmctld/controller.c
index 10b0703e275bf565f3e4ec641b3cd064232312d9..36a9552ba7397ea6d1275322bcc13d00b2f98b47 100644
--- a/src/slurmctld/controller.c
+++ b/src/slurmctld/controller.c
@@ -1,6 +1,6 @@
 /*****************************************************************************\
  *  controller.c - main control machine daemon for slurm
- *  $Id: controller.c 12452 2007-10-05 19:07:07Z da $
+ *  $Id: controller.c 12861 2007-12-19 22:04:25Z jette $
  *****************************************************************************
  *  Copyright (C) 2002-2006 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -897,6 +897,7 @@ static void *_slurmctld_background(void *no_data)
 			last_sched_time = now;
 			if (schedule())
 				last_checkpoint_time = 0;  /* force state save */
+			set_job_elig_time();
 		}
 
 		if (difftime(now, last_trigger) > TRIGGER_INTERVAL) {
diff --git a/src/slurmctld/job_mgr.c b/src/slurmctld/job_mgr.c
index 7d589f168eeae287921eed73cfb5f503de756b82..ac64ee1e7f5e5932a5c9ade926890436af66f285 100644
--- a/src/slurmctld/job_mgr.c
+++ b/src/slurmctld/job_mgr.c
@@ -3,7 +3,7 @@
  *	Note: there is a global job list (job_list), time stamp 
  *	(last_job_update), and hash table (job_hash)
  *
- *  $Id: job_mgr.c 12655 2007-11-20 21:02:43Z jette $
+ *  $Id: job_mgr.c 12861 2007-12-19 22:04:25Z jette $
  *****************************************************************************
  *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -1063,6 +1063,7 @@ extern int kill_running_job_by_node_name(char *node_name, bool step_test)
 				_excise_node_from_job(job_ptr, node_ptr);
 			} else if (job_ptr->batch_flag && job_ptr->details &&
 			           (job_ptr->details->no_requeue == 0)) {
+				uint16_t save_state;
 				info("requeue job %u due to failure of node %s",
 				     job_ptr->job_id, node_name);
 				_set_job_prio(job_ptr);
@@ -1073,7 +1074,15 @@ extern int kill_running_job_by_node_name(char *node_name, bool step_test)
 				else
 					job_ptr->end_time = now;
 				deallocate_nodes(job_ptr, false, suspended);
+
+				/* We want this job to look like it was cancelled in the
+				 * accounting logs. Set a new submit time so the restarted
+				 * job looks like a new job. */
+				save_state = job_ptr->job_state;
+				job_ptr->job_state  = JOB_CANCELLED;
 				job_completion_logger(job_ptr);
+				job_ptr->job_state = save_state;
+				job_ptr->details->submit_time = now;
 			} else {
 				info("Killing job_id %u on failed node %s",
 				     job_ptr->job_id, node_name);
@@ -1351,13 +1360,14 @@ extern int job_allocate(job_desc_msg_t * job_specs, int immediate,
 	error_code = _job_create(job_specs, allocate, will_run,
 				 &job_ptr, submit_uid);
 	*job_pptr = job_ptr;
+	time_t now = time(NULL);
 	
 	if (error_code) {
 		if (immediate && job_ptr) {
 			job_ptr->job_state = JOB_FAILED;
 			job_ptr->exit_code = 1;
 			job_ptr->state_reason = FAIL_BAD_CONSTRAINTS;
-			job_ptr->start_time = job_ptr->end_time = time(NULL);
+			job_ptr->start_time = job_ptr->end_time = now;
 			job_completion_logger(job_ptr);
 		}
 		return error_code;
@@ -1389,7 +1399,7 @@ extern int job_allocate(job_desc_msg_t * job_specs, int immediate,
 		job_ptr->job_state  = JOB_FAILED;
 		job_ptr->exit_code  = 1;
 		job_ptr->state_reason = FAIL_BAD_CONSTRAINTS;
-		job_ptr->start_time = job_ptr->end_time = time(NULL);
+		job_ptr->start_time = job_ptr->end_time = now;
 		job_completion_logger(job_ptr);
 		if (!independent)
 			return ESLURM_DEPENDENCY;
@@ -1405,18 +1415,23 @@ extern int job_allocate(job_desc_msg_t * job_specs, int immediate,
 		(!top_prio) || (!independent);
 	error_code = select_nodes(job_ptr, no_alloc, NULL);
 	if (!test_only) {
-		last_job_update = time(NULL);
+		last_job_update = now;
 		slurm_sched_schedule();	/* work for external scheduler */
 	}
-	if ((error_code == ESLURM_NODES_BUSY)
-	    ||  (error_code == ESLURM_JOB_HELD)
-	    ||  (error_code == ESLURM_REQUESTED_PART_CONFIG_UNAVAILABLE)) {
+	if (independent &&
+	    (job_ptr->details && (job_ptr->details->begin_time == 0)) &&
+	    ((error_code == SLURM_SUCCESS) || (error_code == ESLURM_NODES_BUSY)))
+		job_ptr->details->begin_time = now;
+ 
+	if ((error_code == ESLURM_NODES_BUSY) ||
+	    (error_code == ESLURM_JOB_HELD) ||
+	    (error_code == ESLURM_REQUESTED_PART_CONFIG_UNAVAILABLE)) {
 		/* Not fatal error, but job can't be scheduled right now */
 		if (immediate) {
 			job_ptr->job_state  = JOB_FAILED;
 			job_ptr->exit_code  = 1;
 			job_ptr->state_reason = FAIL_BAD_CONSTRAINTS;
-			job_ptr->start_time = job_ptr->end_time = time(NULL);
+			job_ptr->start_time = job_ptr->end_time = now;
 			job_completion_logger(job_ptr);
 		} else {	/* job remains queued */
 			if (error_code == ESLURM_NODES_BUSY) {
@@ -1430,7 +1445,7 @@ extern int job_allocate(job_desc_msg_t * job_specs, int immediate,
 		job_ptr->job_state  = JOB_FAILED;
 		job_ptr->exit_code  = 1;
 		job_ptr->state_reason = FAIL_BAD_CONSTRAINTS;
-		job_ptr->start_time = job_ptr->end_time = time(NULL);
+		job_ptr->start_time = job_ptr->end_time = now;
 		job_completion_logger(job_ptr);
 		return error_code;
 	}
@@ -1438,7 +1453,7 @@ extern int job_allocate(job_desc_msg_t * job_specs, int immediate,
 	if (will_run) {		/* job would run, flag job destruction */
 		job_ptr->job_state  = JOB_FAILED;
 		job_ptr->exit_code  = 1;
-		job_ptr->start_time = job_ptr->end_time = time(NULL);
+		job_ptr->start_time = job_ptr->end_time = now;
 	} 
 	return SLURM_SUCCESS;
 }
@@ -1628,6 +1643,7 @@ extern int job_complete(uint32_t job_id, uid_t uid, bool requeue,
 	time_t now = time(NULL);
 	uint32_t job_comp_flag = 0;
 	bool suspended = false;
+
 	info("completing job %u", job_id);
 	job_ptr = find_job_record(job_id);
 	if (job_ptr == NULL) {
@@ -1673,7 +1689,7 @@ extern int job_complete(uint32_t job_id, uid_t uid, bool requeue,
 		job_completion_logger(job_ptr);
 	} else {
 		if (job_return_code == NO_VAL) {
-			job_ptr->job_state = JOB_CANCELLED| job_comp_flag;
+			job_ptr->job_state = JOB_CANCELLED | job_comp_flag;
 			job_ptr->requid = uid;
 		} else if (WIFEXITED(job_return_code) &&
 		           WEXITSTATUS(job_return_code)) {
@@ -2235,17 +2251,18 @@ _read_data_array_from_file(char *file_name, char ***data, uint16_t * size)
 	buf_size = BUF_SIZE;
 	buffer = xmalloc(buf_size);
 	while (1) {
-		amount = read(fd, &buffer[pos], buf_size);
+		amount = read(fd, &buffer[pos], BUF_SIZE);
 		if (amount < 0) {
 			error("Error reading file %s, %m", file_name);
 			xfree(buffer);
 			close(fd);
 			return;
 		}
-		if (amount < buf_size)	/* end of file */
+		if (amount < BUF_SIZE)	/* end of file */
 			break;
 		pos += amount;
-		xrealloc(buffer, (pos + buf_size));
+		buf_size += amount;
+		xrealloc(buffer, buf_size);
 	}
 	close(fd);
 
@@ -2291,17 +2308,18 @@ void _read_data_from_file(char *file_name, char **data)
 	buf_size = BUF_SIZE;
 	buffer = xmalloc(buf_size);
 	while (1) {
-		amount = read(fd, &buffer[pos], buf_size);
+		amount = read(fd, &buffer[pos], BUF_SIZE);
 		if (amount < 0) {
 			error("Error reading file %s, %m", file_name);
 			xfree(buffer);
 			close(fd);
 			return;
 		}
-		if (amount < buf_size)	/* end of file */
+		if (amount < BUF_SIZE)	/* end of file */
 			break;
 		pos += amount;
-		xrealloc(buffer, (pos + buf_size));
+		buf_size += amount;
+		xrealloc(buffer, buf_size);
 	}
 
 	*data = buffer;
@@ -3383,8 +3401,11 @@ int update_job(job_desc_msg_t * job_specs, uid_t uid)
 	last_job_update = now;
 
 	if ((job_specs->time_limit != NO_VAL) && (!IS_JOB_FINISHED(job_ptr))) {
-		if (super_user ||
-		    (job_ptr->time_limit > job_specs->time_limit)) {
+		if (job_ptr->time_limit == job_specs->time_limit) {
+			verbose("update_job: new time limit identical to old "
+				"time limit %u", job_specs->job_id);
+		} else if (super_user ||
+			   (job_ptr->time_limit > job_specs->time_limit)) {
 			time_t old_time =  job_ptr->time_limit;
 			if (old_time == INFINITE)	/* one year in mins */
 				old_time = (365 * 24 * 60);
@@ -4728,6 +4749,7 @@ extern int job_requeue (uid_t uid, uint32_t job_id, slurm_fd conn_fd)
 	slurm_msg_t resp_msg;
 	return_code_msg_t rc_msg;
 	time_t now = time(NULL);
+	uint16_t save_state;
 
 	/* find the job */
 	job_ptr = find_job_record (job_id);
@@ -4747,7 +4769,7 @@ extern int job_requeue (uid_t uid, uint32_t job_id, slurm_fd conn_fd)
 		rc = ESLURM_ALREADY_DONE;
 		goto reply;
 	}
-	if (job_ptr->details && job_ptr->details->no_requeue) {
+	if ((job_ptr->details == NULL) || job_ptr->details->no_requeue) {
 		rc = ESLURM_DISABLED;
 		goto reply;
 	}
@@ -4786,10 +4808,16 @@ extern int job_requeue (uid_t uid, uint32_t job_id, slurm_fd conn_fd)
 	else
 		job_ptr->end_time = now;
 	deallocate_nodes(job_ptr, false, suspended);
-	if (job_ptr->details)
-		xfree(job_ptr->details->req_node_layout);
+	xfree(job_ptr->details->req_node_layout);
+
+	/* We want this job to look like it was cancelled in the
+	 * accounting logs. Set a new submit time so the restarted
+	 * job looks like a new job. */
+	save_state = job_ptr->job_state;
+	job_ptr->job_state  = JOB_CANCELLED;
 	job_completion_logger(job_ptr);
-//FIXME: Test accounting
+	job_ptr->job_state = save_state;
+	job_ptr->details->submit_time = now;
 
     reply:
 	if (conn_fd >= 0) {
diff --git a/src/slurmctld/job_scheduler.c b/src/slurmctld/job_scheduler.c
index 1823ae06d998d410b810661c2fa16eb810b85897..6a7457334f3afe8d0234e9de21ebf136d37f9cbd 100644
--- a/src/slurmctld/job_scheduler.c
+++ b/src/slurmctld/job_scheduler.c
@@ -139,6 +139,46 @@ extern bool job_is_completing(void)
 	return completing;
 }
 
+/*
+ * set_job_elig_time - set the eligible time for pending jobs once their
+ *      dependencies are lifted (in job->details->begin_time)
+ */
+extern void set_job_elig_time(void)
+{
+	struct job_record *job_ptr = NULL;
+	struct part_record *part_ptr = NULL;
+	ListIterator job_iterator;
+	slurmctld_lock_t job_write_lock =
+		{ READ_LOCK, WRITE_LOCK, WRITE_LOCK, READ_LOCK };
+	time_t now = time(NULL);
+
+	lock_slurmctld(job_write_lock);
+	job_iterator = list_iterator_create(job_list);
+	while ((job_ptr = (struct job_record *) list_next(job_iterator))) {
+		part_ptr = job_ptr->part_ptr;
+		if (job_ptr->job_state != JOB_PENDING)
+			continue;
+		if (part_ptr == NULL)
+			continue;
+		if ((job_ptr->details == NULL) || job_ptr->details->begin_time)
+			continue;
+		if (part_ptr->state_up == 0)
+			continue;
+		if ((job_ptr->time_limit != NO_VAL) &&
+		    (job_ptr->time_limit > part_ptr->max_time))
+			continue;
+		if ((job_ptr->details->max_nodes != 0) &&
+		    ((job_ptr->details->max_nodes < part_ptr->min_nodes) ||
+		     (job_ptr->details->min_nodes > part_ptr->max_nodes)))
+			continue;
+		if (!job_independent(job_ptr))
+			continue;
+		job_ptr->details->begin_time = now;
+	}
+	list_iterator_destroy(job_iterator);
+	unlock_slurmctld(job_write_lock);
+}
+
 /* 
  * schedule - attempt to schedule all pending jobs
  *	pending jobs for each partition will be scheduled in priority  
diff --git a/src/slurmctld/node_scheduler.c b/src/slurmctld/node_scheduler.c
index 20cf46bccef4a17b41a262b220614918ed0c4d80..1baf6bf9d0b57353b7390e5f585a4ee72efdf954 100644
--- a/src/slurmctld/node_scheduler.c
+++ b/src/slurmctld/node_scheduler.c
@@ -2,7 +2,7 @@
  *  node_scheduler.c - select and allocated nodes to jobs 
  *	Note: there is a global node table (node_record_table_ptr) 
  *
- *  $Id: node_scheduler.c 12631 2007-11-06 22:48:18Z da $
+ *  $Id: node_scheduler.c 12863 2007-12-19 23:14:45Z jette $
  *****************************************************************************
  *  Copyright (C) 2002-2006 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -42,6 +42,10 @@
 #  include "config.h"
 #endif
 
+#ifdef HAVE_SYS_SYSLOG_H
+#  include <sys/syslog.h>
+#endif
+
 #include <errno.h>
 #include <pthread.h>
 #include <stdio.h>
@@ -1000,6 +1004,7 @@ extern int select_nodes(struct job_record *job_ptr, bool test_only,
 	uint32_t min_nodes, max_nodes, req_nodes;
 	int super_user = false;
 	enum job_state_reason fail_reason;
+	time_t now = time(NULL);
 
 	xassert(job_ptr);
 	xassert(job_ptr->magic == JOB_MAGIC);
@@ -1033,7 +1038,7 @@ extern int select_nodes(struct job_record *job_ptr, bool test_only,
 		 fail_reason = WAIT_PART_NODE_LIMIT;
 	if (fail_reason != WAIT_NO_REASON) {
 		job_ptr->state_reason = fail_reason;
-		last_job_update = time(NULL);
+		last_job_update = now;
 		if (job_ptr->priority == 0)	/* user/admin hold */
 			return ESLURM_JOB_HELD;
 		job_ptr->priority = 1;	/* sys hold, move to end of queue */
@@ -1100,7 +1105,7 @@ extern int select_nodes(struct job_record *job_ptr, bool test_only,
 			       job_ptr->job_id);
 			if (job_ptr->priority != 0)  /* Move to end of queue */
 				job_ptr->priority = 1;
-			last_job_update = time(NULL);
+			last_job_update = now;
 		} else if (error_code == ESLURM_NODES_BUSY)
 			slurm_sched_job_is_pending();
 		goto cleanup;
@@ -1136,7 +1141,7 @@ extern int select_nodes(struct job_record *job_ptr, bool test_only,
 		error("select_g_update_nodeinfo(%u): %m", job_ptr->job_id);
 		/* not critical ... by now */
 	}
-	job_ptr->start_time = job_ptr->time_last_active = time(NULL);
+	job_ptr->start_time = job_ptr->time_last_active = now;
 	if (job_ptr->time_limit == NO_VAL)
 		job_ptr->time_limit = part_ptr->max_time;
 	if (job_ptr->time_limit == INFINITE)
@@ -1405,6 +1410,7 @@ extern void build_node_details(struct job_record *job_ptr)
         int error_code = SLURM_SUCCESS;
 	int node_inx = 0, cpu_inx = -1;
         int cr_count = 0;
+	uint32_t total_procs = 0;
 
 	if ((job_ptr->node_bitmap == NULL) || (job_ptr->nodes == NULL)) {
 		/* No nodes allocated, we're done... */
@@ -1451,6 +1457,7 @@ extern void build_node_details(struct job_record *job_ptr)
 				
 				job_ptr->cpus_per_node[cpu_inx] =
 					job_ptr->num_procs;
+				total_procs += job_ptr->num_procs;
 				job_ptr->cpu_count_reps[cpu_inx] = 1;
 				goto cleanup;
 			}
@@ -1482,7 +1489,8 @@ extern void build_node_details(struct job_record *job_ptr)
 				job_ptr->cpu_count_reps[cpu_inx] = 1;
 			} else
 				job_ptr->cpu_count_reps[cpu_inx]++;
-			
+			total_procs +=  usable_lps;
+
 		} else {
 			error("Invalid node %s in JobId=%u",
 			      this_node_name, job_ptr->job_id);
@@ -1498,6 +1506,8 @@ extern void build_node_details(struct job_record *job_ptr)
 		      job_ptr->job_id, job_ptr->node_cnt, node_inx);
 	}
 	job_ptr->num_cpu_groups = cpu_inx + 1;
+	if (job_ptr->details)
+		job_ptr->details->total_procs = total_procs;
 }
 
 /*
diff --git a/src/slurmctld/read_config.c b/src/slurmctld/read_config.c
index aca9e9bba65c27f6e9d00a335723c7b0d9dea0ad..49b8d18fd0f51117143ab402b8fb231fb791e42b 100644
--- a/src/slurmctld/read_config.c
+++ b/src/slurmctld/read_config.c
@@ -39,6 +39,10 @@
 #  include "config.h"
 #endif
 
+#ifdef HAVE_SYS_SYSLOG_H
+#  include <sys/syslog.h>
+#endif
+
 #include <ctype.h>
 #include <errno.h>
 #include <fcntl.h>
diff --git a/src/slurmctld/slurmctld.h b/src/slurmctld/slurmctld.h
index 25a36dd3bbde8b1e4d024099d1cbbd6d9f7eabc6..d1a2649db79d911b9bef56a00c9485f7e9c6e285 100644
--- a/src/slurmctld/slurmctld.h
+++ b/src/slurmctld/slurmctld.h
@@ -1,7 +1,7 @@
 /*****************************************************************************\
  *  slurmctld.h - definitions of functions and structures for slurmcltd use
  *
- *  $Id: slurmctld.h 11795 2007-07-06 15:39:25Z jette $
+ *  $Id: slurmctld.h 12863 2007-12-19 23:14:45Z jette $
  *****************************************************************************
  *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -301,7 +301,9 @@ struct job_details {
 	uint32_t total_procs;		/* number of allocated processors, 
 					   for accounting */
 	time_t submit_time;		/* time of submission */
-	time_t begin_time;		/* start after this time */
+	time_t begin_time;		/* start at this time (srun --being), 
+					 * resets to time first eligible
+					 * (all dependencies satisfied) */
 	char *work_dir;			/* pathname of working directory */
 	char **argv;			/* arguments for a batch job script */
 	uint16_t argc;			/* count of argv elements */
@@ -331,7 +333,7 @@ struct job_record {
 	char *nodes_completing;		/* nodes still in completing state
 					 * for this job, used to insure
 					 * epilog is not re-run for job */
-	uint32_t num_procs;		/* count of required/allocated processors */
+	uint32_t num_procs;		/* count of required processors */
 	uint32_t time_limit;		/* time_limit minutes or INFINITE,
 					 * NO_VAL implies partition max_time */
 	time_t start_time;		/* time execution begins, 
@@ -1201,6 +1203,12 @@ extern void save_all_state(void);
  */
 extern int schedule (void);
 
+/*
+ * set_job_elig_time - set the eligible time for pending jobs once their 
+ *	dependencies are lifted (in job->details->begin_time)
+ */
+extern void set_job_elig_time(void);
+
 /*
  * set_node_down - make the specified node's state DOWN if possible
  *	(not in a DRAIN state), kill jobs as needed 
diff --git a/src/smap/smap.c b/src/smap/smap.c
index 077f16f1a5239596344a58f5042afb029056133e..9b8652f4866daa28a78d1089972c094d4bcada75 100644
--- a/src/smap/smap.c
+++ b/src/smap/smap.c
@@ -1,6 +1,6 @@
 /*****************************************************************************\
  *  smap.c - Report overall state the system
- *  $Id: smap.c 11985 2007-08-09 23:07:08Z da $
+ *  $Id: smap.c 12858 2007-12-19 20:15:32Z da $
  *****************************************************************************
  *  Copyright (C) 2004 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -64,7 +64,7 @@ int main_xcord = 1;
 int main_ycord = 1;
 WINDOW *grid_win = NULL;
 WINDOW *text_win = NULL;
-		
+
 /************
  * Functions *
  ************/
@@ -111,7 +111,10 @@ int main(int argc, char *argv[])
 			
 #ifdef HAVE_BG_FILES
 		if (!have_db2) {
-			printf("must be on BG SN to resolve.\n");
+			printf("Required libraries can not be found "
+			       "to access the Bluegene system.\nPlease "
+			       "set your LD_LIBRARY_PATH correctly to "
+			       "point to them.\n");
 			goto part_fini;
 		}
 
@@ -149,7 +152,7 @@ int main(int argc, char *argv[])
 		}
 part_fini:
 #else
-		printf("must be on BG SN to resolve.\n");
+		printf("Must be on BG System to resolve.\n");
 #endif
 		ba_fini();
 		exit(0);
@@ -245,7 +248,7 @@ part_fini:
 			break;
 #else
 		default:
-			error("must be on a BG SYSTEM to run this command");
+			error("Must be on a BG SYSTEM to run this command");
 			endwin();
 			ba_fini();
 			exit(0);
diff --git a/src/srun/msg.c b/src/srun/msg.c
index 735c1ce81a2e80b9d68f77e2a4825f5f102d2c34..21e2d12a1574c4c2645e69a499ef875c6f4a9f68 100644
--- a/src/srun/msg.c
+++ b/src/srun/msg.c
@@ -1,6 +1,6 @@
 /****************************************************************************\
  *  msg.c - process message traffic between srun and slurm daemons
- *  $Id: msg.c 12538 2007-10-23 17:11:04Z jette $
+ *  $Id: msg.c 12809 2007-12-11 18:41:21Z jette $
  *****************************************************************************
  *  Copyright (C) 2002 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -213,7 +213,7 @@ static void _handle_update_mpir_proctable(int fd, srun_job_t *job)
 	   call the Breakpoint */
 	if (tasks_recorded == job->step_layout->task_cnt) {
 		if (opt.multi_prog)
-			set_multi_name(ntasks);
+			set_multi_name(tasks_recorded);
 		MPIR_debug_state = MPIR_DEBUG_SPAWNED;
 		MPIR_Breakpoint();
 		if (opt.debugger_test)
@@ -1306,6 +1306,8 @@ par_thr(void *arg)
 	//slurm_uid = (uid_t) slurm_get_slurm_user_id();
 	close(msg_par->msg_pipe[0]); // close read end of pipe
 	close(par_msg->msg_pipe[1]); // close write end of pipe 
+	/* Note: On some message types, we read a task ID as the 
+	 * first number then read status or exit code as the second */
 	while(read(par_msg->msg_pipe[0], &c, sizeof(int)) 
 	      == sizeof(int)) {
 		// getting info from msg thread
@@ -1321,11 +1323,11 @@ par_thr(void *arg)
 			update_job_state(job, c);
 			break;
 		case PIPE_TASK_STATE:
-			debug("PIPE_TASK_STATE, c = %d", c);
 			if(tid == -1) {
 				tid = c;
 				continue;
 			}
+			debug("PIPE_TASK_STATE tid=%d, state=%d", tid, c);
 			slurm_mutex_lock(&job->task_mutex);
 			job->task_state[tid] = c;
 			if(c == SRUN_TASK_FAILED)
@@ -1338,14 +1340,12 @@ par_thr(void *arg)
 			tid = -1;
 			break;
 		case PIPE_TASK_EXITCODE:
-			debug("PIPE_TASK_EXITCODE");
 			if(tid == -1) {
-				debug("  setting tid");
 				tid = c;
 				continue;
 			}
+			debug("PIPE_TASK_EXITCODE tid=%d code=%d", tid, c);
 			slurm_mutex_lock(&job->task_mutex);
-			debug("  setting task %d exitcode %d", tid, c);
 			job->tstatus[tid] = c;
 			slurm_mutex_unlock(&job->task_mutex);
 			tid = -1;
diff --git a/src/srun/multi_prog.c b/src/srun/multi_prog.c
index 364d8a8c0959d57784203c4957cd4b2e9fe38990..f2d49dcbd6ef7eee7f0469fd3202c7531e1cf3e2 100644
--- a/src/srun/multi_prog.c
+++ b/src/srun/multi_prog.c
@@ -127,45 +127,46 @@ _set_range(int low_num, int high_num, char *exec_name)
 static void
 _set_exec_names(char *ranks, char *exec_name, int ntasks)
 {
-	char *range = NULL, *p = NULL;
-	char *ptrptr = NULL, *exec_path = NULL, *upper = NULL;
-	int low_num, high_num;
+	char *ptrptr = NULL, *exec_path = NULL;
+	int low_num, high_num, num, i;
 
-	if (ranks[0] == '*' && ranks[1] == '\0') {
+	exec_path = _build_path(exec_name);
+	if ((ranks[0] == '*') && (ranks[1] == '\0')) {
 		low_num = 0;
 		high_num = ntasks - 1;
-		_set_range(low_num, high_num, exec_name);
+		_set_range(low_num, high_num, exec_path);
 		return;
 	}
-	exec_path = _build_path(exec_name);
 
-	for (range = strtok_r(ranks, ",", &ptrptr); range != NULL;
-			range = strtok_r(NULL, ",", &ptrptr)) {
-		p = range;
-		while (*p != '\0' && isdigit (*p))
-			p ++;
+	ptrptr = ranks;
+	for (i=0; i<ntasks; i++) {
+		if (!isdigit(ptrptr[0]))
+			goto invalid;
 
-		if (*p == '\0') { /* single rank */
-			low_num  = MAX(0, atoi(range));
-			high_num = MIN((ntasks-1), atoi(range));
+		num = strtol(ptrptr, &ptrptr, 10);
+
+		if ((ptrptr[0] == ',') || (ptrptr[0] == '\0')) {
+			low_num = MAX(0, num);
+			high_num = MIN((ntasks-1), num);
 			_set_range(low_num, high_num, exec_path);
-		} else if (*p == '-') { /* lower-upper */
-			upper = ++ p;
-			while (isdigit (*p))
-				p ++;
-			if (*p != '\0') {
-				error ("Invalid task range specification (%s) "
-					"ignored.", range);
-				continue;
-			}
-			low_num  = MAX(0, atoi (range));
-			high_num = MIN((ntasks-1), atoi(upper));
+		} else if (ptrptr[0] == '-') {
+			low_num = MAX(0, num);
+			num = strtol(ptrptr+1, &ptrptr, 10);
+			if ((ptrptr[0] != ',') && (ptrptr[0] != '\0'))
+				goto invalid; 
+			high_num = MIN((ntasks-1), num);
 			_set_range(low_num, high_num, exec_path);
-		} else {
-			error ("Invalid task range specification (%s) ignored.",
-				range);
-		}
+		} else
+			goto invalid;
+		if (ptrptr[0] == '\0')
+			break;
+		ptrptr++;
 	}
+	return;
+
+  invalid:
+	error ("Invalid task range specification (%s) ignored.", ranks);
+	return;
 }
 
 extern int
diff --git a/src/srun/opt.c b/src/srun/opt.c
index e00bf4f232e8ae13d2daed56fc06f40459eb3e54..fca5cf8ead2e5b4f7fee62b664205e17ab79d4db 100644
--- a/src/srun/opt.c
+++ b/src/srun/opt.c
@@ -1,6 +1,6 @@
 /*****************************************************************************\
  *  opt.c - options processing for srun
- *  $Id: opt.c 12711 2007-11-29 00:04:01Z jette $
+ *  $Id: opt.c 12856 2007-12-19 00:18:44Z jette $
  *****************************************************************************
  *  Copyright (C) 2002-2006 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -1871,8 +1871,10 @@ void set_options(const int argc, char **argv, int first)
 			break;
 		case LONG_OPT_PROPAGATE:
 			xfree(opt.propagate);
-			if (optarg) opt.propagate = xstrdup(optarg);
-			else	    opt.propagate = xstrdup("ALL");
+			if (optarg)
+				opt.propagate = xstrdup(optarg);
+			else
+				opt.propagate = xstrdup("ALL");
 			break;
 		case LONG_OPT_PROLOG:
 			xfree(opt.prolog);
diff --git a/testsuite/expect/README b/testsuite/expect/README
index 415879e1316e2ce954b70de465706922bd9e7fb9..6d1ae1ad0a081f36a0f514c77ee41671d3e1d3f5 100644
--- a/testsuite/expect/README
+++ b/testsuite/expect/README
@@ -546,3 +546,11 @@ test19.5   strigger --set (job options)
 test19.6   strigger --clear and --get (with filtering)
 test19.7   strigger --set --idle
 
+
+test20.#   Testing of PBS commands and Perl APIs.
+=================================================
+test20.1   qsub command tests
+test20.2   qstat command tests
+test20.3   qdel command tests
+test20.4   pbsnodes command tests
+
diff --git a/testsuite/expect/globals b/testsuite/expect/globals
index 005cb3dacf1d64ebb80140608980c5574c130092..4e249c9464fe2c626e844ccb9878e0308c48cb81 100755
--- a/testsuite/expect/globals
+++ b/testsuite/expect/globals
@@ -67,6 +67,11 @@ cset squeue      "${slurm_dir}/bin/squeue"
 cset srun        "${slurm_dir}/bin/srun"
 cset strigger    "${slurm_dir}/bin/strigger"
 
+cset pbsnodes    "${slurm_dir}/bin/pbsnodes"
+cset qdel        "${slurm_dir}/bin/qdel"
+cset qstat       "${slurm_dir}/bin/qstat"
+cset qsub        "${slurm_dir}/bin/qsub"
+
 # If length of string partition is zero, use output of function 
 #	default_partition, otherwise use the partition explicitly 
 #	named in your globals.local file (or below) for poe commands
diff --git a/testsuite/expect/test10.12 b/testsuite/expect/test10.12
index b51b2bb5fe2bd0092152f80560430820f0cfa835..3ce11585b2a57b5bdf801acf58d0fdefe6c2e16c 100755
--- a/testsuite/expect/test10.12
+++ b/testsuite/expect/test10.12
@@ -38,6 +38,11 @@ set non_bg      0
 
 print_header $test_id
 
+if { [test_bluegene] == 0 } {
+	send_user "\nWARNING: This test is only compatable with bluegene systems\n"
+	exit 0
+}
+
 #
 # Test smap resolve ablilty
 # for XYZ coords to Rack Midplane
diff --git a/testsuite/expect/test20.1 b/testsuite/expect/test20.1
new file mode 100755
index 0000000000000000000000000000000000000000..70d7f1e6da4aa0672bf9035f94234b54eb83036a
--- /dev/null
+++ b/testsuite/expect/test20.1
@@ -0,0 +1,115 @@
+#!/usr/bin/expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          qsub command tests
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2007 The Regents of the University of California.
+# Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
+# Written by Morris Jette <jette1@llnl.gov>
+# UCRL-CODE-226842.
+# 
+# This file is part of SLURM, a resource management program.
+# For details, see <http://www.llnl.gov/linux/slurm/>.
+#  
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+# 
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+# 
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
+############################################################################
+source ./globals
+
+set test_id     "20.1"
+set exit_code   0
+set file_err	"test$test_id.error"
+set file_in	"test$test_id.input"
+set file_out	"test$test_id.output"
+
+print_header $test_id
+
+if {[file executable $qsub] == 0} {
+	send_user "\nWARNING: $qsub not found\n"
+	exit 0
+}
+
+set job_id 0
+exec rm -f $file_out $file_err
+make_bash_script $file_in "$bin_echo HELLO; $bin_cat /dummy_file"
+spawn $qsub -e $file_err -o $file_out $file_in
+expect {
+	-re "Submitted batch job ($number)" {
+		set job_id $expect_out(1,string)
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: qsub not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+if {$job_id == 0} {
+	send_user "\nFAILURE: qsub failed to submit job\n"
+	exit 1
+}
+
+if {[wait_for_file $file_out] != 0} {
+	send_user "\nFAILURE: qsub output file not found\n"
+	catch {exec $qdel $job_id}
+	exit 1
+}
+set matches 0
+spawn $bin_cat $file_out
+expect {
+	-re "HELLO" {
+		incr matches
+		exp_continue
+	}
+	eof {
+		wait
+	}
+}
+if {$matches != 1} {
+	send_user "\nFAILURE: unexpected qsub output file contents\n"
+	set exit_code 1
+}
+
+if {[wait_for_file $file_err] != 0} {
+	send_user "\nFAILURE: qsub error file not found\n"
+	catch {exec $qdel $job_id}
+	exit 1
+}
+set matches 0
+spawn $bin_cat $file_err
+expect {
+	-re "No such file" {
+		incr matches
+		exp_continue
+	}
+	eof {
+		wait
+	}
+}
+if {$matches != 1} {
+	send_user "\nFAILURE: unexpected qsub error file contents\n"
+	set exit_code 1
+}
+
+if {$exit_code == 0} {
+	exec $bin_rm -f $file_in $file_out $file_err
+	send_user "\nSUCCESS\n"
+}
+exit $exit_code
diff --git a/testsuite/expect/test20.2 b/testsuite/expect/test20.2
new file mode 100755
index 0000000000000000000000000000000000000000..9caca3a3a95f484cf24827bd2b9a0c9987479635
--- /dev/null
+++ b/testsuite/expect/test20.2
@@ -0,0 +1,101 @@
+#!/usr/bin/expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          qstat command tests
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2007 The Regents of the University of California.
+# Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
+# Written by Morris Jette <jette1@llnl.gov>
+# UCRL-CODE-226842.
+# 
+# This file is part of SLURM, a resource management program.
+# For details, see <http://www.llnl.gov/linux/slurm/>.
+#  
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+# 
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+# 
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
+############################################################################
+source ./globals
+
+set test_id     "20.2"
+set exit_code   0
+set file_in	"test$test_id.input"
+set file_out	"test$test_id.output"
+set job_name	"test$test_id"
+
+print_header $test_id
+
+if {[file executable $qsub] == 0} {
+	send_user "\nWARNING: $qsub does not exists\n"
+	exit 0
+}
+if {[file executable $qstat] == 0} {
+	send_user "\nWARNING: $qstat does not exists\n"
+	exit 0
+}
+if {[file executable $qdel] == 0} {
+	send_user "\nWARNING: $qdel does not exists\n"
+	exit 0
+}
+
+set job_id 0
+make_bash_script $file_in "sleep 60"
+spawn $qsub -o $file_out -N $job_name $file_in
+expect {
+	-re "Submitted batch job ($number)" {
+		set job_id $expect_out(1,string)
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: qsub not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+if {$job_id == 0} {
+	send_user "\nFAILURE: qsub failed to submit job\n"
+	exit 1
+}
+
+set matches 0
+spawn $qstat $job_id
+expect {
+	-re "$job_name" {
+		incr matches
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: qstat not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+if {$matches != 1} {
+	send_user "\nFAILURE: qstat failed to report job\n"
+	set exit_code 1
+}
+catch {exec $qdel $job_id}
+
+if {$exit_code == 0} {
+	exec $bin_rm -f $file_in $file_out
+	send_user "\nSUCCESS\n"
+}
+exit $exit_code
diff --git a/testsuite/expect/test20.3 b/testsuite/expect/test20.3
new file mode 100755
index 0000000000000000000000000000000000000000..e564f6f5ce157c5247359a754a43857bb674b2bf
--- /dev/null
+++ b/testsuite/expect/test20.3
@@ -0,0 +1,112 @@
+#!/usr/bin/expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          qdel command tests
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2007 The Regents of the University of California.
+# Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
+# Written by Morris Jette <jette1@llnl.gov>
+# UCRL-CODE-226842.
+# 
+# This file is part of SLURM, a resource management program.
+# For details, see <http://www.llnl.gov/linux/slurm/>.
+#  
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+# 
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+# 
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
+############################################################################
+source ./globals
+
+set test_id     "20.3"
+set exit_code   0
+set file_in	"test$test_id.input"
+set file_out	"test$test_id.output"
+
+print_header $test_id
+
+if {[file executable $qsub] == 0} {
+	send_user "\nWARNING: $qsub does not exists\n"
+	exit 0
+}
+if {[file executable $qdel] == 0} {
+	send_user "\nWARNING: $qdel does not exists\n"
+	exit 0
+}
+
+set job_id 0
+make_bash_script $file_in "sleep 60"
+spawn $qsub -o $file_out $file_in
+expect {
+	-re "Submitted batch job ($number)" {
+		set job_id $expect_out(1,string)
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: qsub not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+if {$job_id == 0} {
+	send_user "\nFAILURE: qsub failed to submit job\n"
+	exit 1
+}
+
+spawn $qdel $job_id
+expect {
+	-re "Invalid job id" {
+		send_user "\nFAILURE: qdel failed to delete job\n"
+		set exit_code 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: qdel not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+set matches 0
+spawn $qdel $job_id
+expect {
+	-re "already completing or completed" {
+		send_user "\nThis error was expected, no worries\n"
+		incr matches
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: qdel not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+if {$matches != 1} {
+	send_user "\nFAILURE: No error on attempt to cancel terminated job\n"
+	set exit_code 1
+}
+
+if {$exit_code == 0} {
+	exec $bin_rm -f $file_in $file_out
+	send_user "\nSUCCESS\n"
+}
+exit $exit_code
diff --git a/testsuite/expect/test20.4 b/testsuite/expect/test20.4
new file mode 100755
index 0000000000000000000000000000000000000000..133ce152bcfb7a1eb10e0369c392dd51e2e3a05c
--- /dev/null
+++ b/testsuite/expect/test20.4
@@ -0,0 +1,67 @@
+#!/usr/bin/expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          pbsnodes command tests
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2007 The Regents of the University of California.
+# Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
+# Written by Morris Jette <jette1@llnl.gov>
+# UCRL-CODE-226842.
+# 
+# This file is part of SLURM, a resource management program.
+# For details, see <http://www.llnl.gov/linux/slurm/>.
+#  
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+# 
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+# 
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
+############################################################################
+source ./globals
+
+set test_id     "20.4"
+set exit_code   0
+
+print_header $test_id
+
+if {[file executable $pbsnodes] == 0} {
+	send_user "\nWARNING: $pbsnodes does not exists\n"
+	exit 0
+}
+
+set matches 0
+spawn $pbsnodes
+expect {
+	-re "state.*pcpus" {
+		incr matches
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: pbsnodes not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+if {$matches == 0} {
+	send_user "\nFAILURE: pbsnodes output failure\n"
+	set exit_code 1
+}
+
+if {$exit_code == 0} {
+	send_user "\nSUCCESS\n"
+}
+exit $exit_code
diff --git a/testsuite/expect/test7.7.prog.c b/testsuite/expect/test7.7.prog.c
index 4c7d1e4cae7b44c756d911c3eeb2a53101e5b51f..982787a195b4a2a506df7696e9d4327242659a13 100644
--- a/testsuite/expect/test7.7.prog.c
+++ b/testsuite/expect/test7.7.prog.c
@@ -328,6 +328,7 @@ static void _modify_job(long my_job_id)
 
 	snprintf(out_msg, sizeof(out_msg),
 		"TS=%u AUTH=root DT=CMD=MODIFYJOB ARG=%ld "
+		/* "JOBNAME=foo " */
 		/* "PARTITION=pdebug " */
 		/* "NODES=2 " */ 
 		/* "DEPEND=afterany:3 " */