[torqueusers] [PATCH] pbs_mom truncates pid file if can't lock it

Garrick Staples garrick at usc.edu
Mon Nov 1 16:20:01 MST 2004


It seems that if you start pbs_mom when it is already running, it truncates the
lock/pid file.  It opens the mom.lock with O_TRUNC and *also* calls ftruncate()
after successfully locking it.  Here's the one-liner that corrects this
behaviour..


diff -ruN torque-1.1.0p4_orig/src/resmom/mom_main.c torque-1.1.0p4/src/resmom/mom_main.c
--- torque-1.1.0p4_orig/src/resmom/mom_main.c	2004-10-28 15:50:48.000000000 -0700
+++ torque-1.1.0p4/src/resmom/mom_main.c	2004-11-01 14:59:12.000000000 -0800
@@ -4245,7 +4245,7 @@
     return(1);
     }
 
-  lockfds = open("mom.lock",O_CREAT|O_TRUNC|O_WRONLY,0644);
+  lockfds = open("mom.lock",O_CREAT|O_WRONLY,0644);
 
   if (lockfds < 0) 
     {

-- 
Garrick Staples, Linux/HPCC Administrator
University of Southern California
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.supercluster.org/pipermail/torqueusers/attachments/20041101/4dfbb259/attachment.bin


More information about the torqueusers mailing list