From 22e7800d8a1c1c1ee9f661908baf62270a59cf27 Mon Sep 17 00:00:00 2001
From: Mark Grondona <mgrondona@llnl.gov>
Date: Wed, 30 Jul 2003 22:50:14 +0000
Subject: [PATCH]  o exit immediately if job state indicates a forceful
 termination

---
 src/srun/srun.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/srun/srun.c b/src/srun/srun.c
index f6681ae061a..bdc107fe856 100644
--- a/src/srun/srun.c
+++ b/src/srun/srun.c
@@ -206,11 +206,16 @@ int main(int ac, char **av)
 
 	/* job is now overdone, clean up  
 	 *
-	 * If job "failed" send SIGKILL to any remaining tasks
+	 * If job "failed" send SIGKILL to any remaining tasks.
+	 * If job is "forcefully terminated" exit immediately.
+	 *
 	 */
 	if (job->state == SRUN_JOB_FAILED) {
 		info("Terminating job");
 		fwd_signal(job, SIGKILL);
+	} else if (job->state == SRUN_JOB_FORCETERM) {
+		job_destroy(job, 0);
+		exit(1);
 	}
 
 	/* wait for launch thread */
-- 
GitLab