From e9dd37c91505b837a917df5ea29c6368a25ba088 Mon Sep 17 00:00:00 2001
From: Luc Papeleux <L.Papeleux@ULiege.be>
Date: Thu, 13 Apr 2023 16:49:52 +0200
Subject: [PATCH] add comment to explain the use of setsid

---
 parametricJob.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/parametricJob.py b/parametricJob.py
index 44861a6..2f19121 100644
--- a/parametricJob.py
+++ b/parametricJob.py
@@ -294,7 +294,7 @@ class ParametricJob(PRMSet):
         #file.write("echo \"at JobId = $jobId\"\n")
         #file.write('%s -x -i $jobId -d "%s"\n' % (sys.argv[0], os.getcwd()) )
         script =  re.sub(r'(.+)Gui.pyw',r'\1.py', sys.argv[0]) #if launched through a Gui => use the basic script instead in batch
-        file.write('setsid %s -x -i %d -d "%s"\n' % (script, launchId, os.getcwd()) )
+        file.write('setsid %s -x -i %d -d "%s"\n' % (script, launchId, os.getcwd()) ) # setsid added to generate a new process group (used to easily kill process tree), else the process group is the same as atd daemon (=> killScript kill all at process running)
         file.close()
         os.chmod(scriptname,0o700)
         
-- 
GitLab