[torquedev] jobs owners purging own jobs?

Andrew J Caird acaird at umich.edu
Thu Feb 23 20:45:15 MST 2006


Is there some reason that the job owner can use the purge ('-p') option on 
his own jobs?  For us this would be handy, so I've added a server setting 
called "owner_purge" that enables this.  A patch against 2.0.0p7 is 
attached.

Comments are very welcome.

Thanks.

--andy
-------------- next part --------------
Only in torque-2.0.0p7-ac/buildutils: self-extract-head-sh
Only in torque-2.0.0p7: confdefs.h
diff -ru torque-2.0.0p7/src/include/pbs_ifl.h torque-2.0.0p7-ac/src/include/pbs_ifl.h
--- torque-2.0.0p7/src/include/pbs_ifl.h	2006-01-27 13:42:09.000000000 -0500
+++ torque-2.0.0p7-ac/src/include/pbs_ifl.h	2006-02-23 21:38:40.000000000 -0500
@@ -224,6 +224,7 @@
 #define ATTR_polljobs    "poll_jobs"
 #define ATTR_downonerror "down_on_error"
 #define ATTR_jobnanny    "job_nanny"
+#define ATTR_ownerpurge   "owner_purge"
 #define ATTR_momjobsync  "mom_job_sync"
 #define ATTR_maildomain  "mail_domain"
 #define ATTR_pbsversion  "pbs_version"
diff -ru torque-2.0.0p7/src/include/qmgr_svr_public.h torque-2.0.0p7-ac/src/include/qmgr_svr_public.h
--- torque-2.0.0p7/src/include/qmgr_svr_public.h	2006-01-27 13:42:09.000000000 -0500
+++ torque-2.0.0p7-ac/src/include/qmgr_svr_public.h	2006-02-23 21:38:28.000000000 -0500
@@ -123,6 +123,7 @@
 ATTR_polljobs,
 ATTR_downonerror,
 ATTR_jobnanny,
+ATTR_ownerpurge,
 ATTR_momjobsync,
 ATTR_maildomain,
 ATTR_pbsversion,
diff -ru torque-2.0.0p7/src/include/server.h torque-2.0.0p7-ac/src/include/server.h
--- torque-2.0.0p7/src/include/server.h	2006-01-27 13:42:08.000000000 -0500
+++ torque-2.0.0p7-ac/src/include/server.h	2006-02-23 22:16:48.000000000 -0500
@@ -128,6 +128,7 @@
         SRV_ATR_LogLevel,
         SRV_ATR_DownOnError,
         SRV_ATR_JobNanny,
+	SRV_ATR_OwnerPurge,
         SRV_ATR_MomJobSync,
         SRV_ATR_MailDomain,
 	SRV_ATR_version,
diff -ru torque-2.0.0p7/src/server/req_delete.c torque-2.0.0p7-ac/src/server/req_delete.c
--- torque-2.0.0p7/src/server/req_delete.c	2006-01-27 13:42:17.000000000 -0500
+++ torque-2.0.0p7-ac/src/server/req_delete.c	2006-02-23 22:38:46.000000000 -0500
@@ -676,8 +676,13 @@
     {
     if (strncmp(preq->rq_extend,delpurgestr,strlen(delpurgestr)) == 0) 
       {
-      if ((preq->rq_perm & (ATR_DFLAG_OPRD|ATR_DFLAG_OPWR|
-                            ATR_DFLAG_MGRD|ATR_DFLAG_MGWR)) != 0)
+      if (( (preq->rq_perm & (ATR_DFLAG_OPRD|ATR_DFLAG_OPWR|
+                            ATR_DFLAG_MGRD|ATR_DFLAG_MGWR)) != 0
+       )
+         || ((svr_chk_owner(preq,pjob) == 0)  && 
+		(server.sv_attr[(int)SRV_ATR_OwnerPurge].at_val.at_long ) )
+       )
+
         {
         sprintf(log_buffer,"purging job without checking MOM");
 
diff -ru torque-2.0.0p7/src/server/svr_attr_def.c torque-2.0.0p7-ac/src/server/svr_attr_def.c
--- torque-2.0.0p7/src/server/svr_attr_def.c	2006-01-27 14:34:49.000000000 -0500
+++ torque-2.0.0p7-ac/src/server/svr_attr_def.c	2006-02-23 21:38:59.000000000 -0500
@@ -286,7 +286,7 @@
 	encode_arst,
 	set_uacl,
 	comp_arst,
-	free_arst, 
+	free_null, 
 	manager_oper_chk,
 	MGR_ONLY_SET,
 	ATR_TYPE_ACL,
@@ -589,6 +589,19 @@
         PARENT_TYPE_SERVER
     },
 
+/* SRV_ATR_OwnerPurge */
+    {   ATTR_ownerpurge,	/* "owner_purge" */
+        decode_b,
+        encode_b,
+        set_b,
+        comp_b,
+        free_null,
+        NULL_FUNC,
+        MGR_ONLY_SET,
+        ATR_TYPE_LONG,
+        PARENT_TYPE_SERVER
+    },
+
 /* SRV_ATR_MomJobSync */
     {	ATTR_momjobsync,	/* "mom_job_sync" */
 	decode_b,


More information about the torquedev mailing list