From 99a15604b169aa13f8b5a60eb35471a78e8dcd28 Mon Sep 17 00:00:00 2001
From: Moe Jette <jette1@llnl.gov>
Date: Thu, 10 Apr 2008 22:00:04 +0000
Subject: [PATCH] svn merge -r13837:13852
 https://eris.llnl.gov/svn/slurm/branches/slurm-1.2

---
 NEWS                     |  2 ++
 src/slurmctld/step_mgr.c | 15 +++++++++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index 0c1e8a67f3b..ae3c6cc9d53 100644
--- a/NEWS
+++ b/NEWS
@@ -239,6 +239,8 @@ documents those changes that are of interest to users and admins.
  -- In srun and sbatch, do not check the PATH env var if an absolute pathname 
     of the program is specified (previously reported an error if no PATH).
  -- Correct output of "sinfo -o %C" (CPU counts by node state).
+ -- Treat attempt to submit a batch job against an existing resource allocation
+    as an error if sched/wiki2 is configured (Moab).
 
 * Changes in SLURM 1.2.25
 =========================
diff --git a/src/slurmctld/step_mgr.c b/src/slurmctld/step_mgr.c
index 7a8e917ea83..1ec6869e96c 100644
--- a/src/slurmctld/step_mgr.c
+++ b/src/slurmctld/step_mgr.c
@@ -820,11 +820,22 @@ step_create(job_step_create_request_msg_t *step_specs,
 	}
 
 	if (batch_step) {
+		static bool wiki_sched = false;
+		static bool wiki_sched_test = false;
+		if (!wiki_sched_test) {
+			char *sched_type = slurm_get_sched_type();
+			if ((strcmp(sched_type, "sched/wiki") == 0) ||
+			    (strcmp(sched_type, "sched/wiki2") == 0))
+				wiki_sched = true;
+			xfree(sched_type);
+			wiki_sched_test = true;
+		}
 		info("user %u attempting to run batch script within "
 			"an existing job", step_specs->user_id);
 		/* This seems hazardous to allow, but LSF seems to 
-		 * work this way, so don't treat it as an error.
-		 * return ESLURM_ACCESS_DENIED ; */
+		 * work this way, so don't treat it as an error. */
+		if (wiki_sched)
+			return ESLURM_ACCESS_DENIED;
 	}
 
 	if ((step_specs->user_id != job_ptr->user_id) &&
-- 
GitLab